@Test
public void testChangesetsAppliedInPhases() {
DbDeployerAppContext dbDeployerAppContext = DbEnvironmentFactory.getInstance()
.readOneFromSourcePath("scenariotests/changesetDeploy/step1")
.buildAppContext()
.setupEnvInfra().cleanEnvironment();
dbDeployerAppContext.deploy();
checkForIndex(dbDeployerAppContext, "TABLE_A", "TABLE_A_IND1", false);
checkForIndex(dbDeployerAppContext, "TABLE_B", "TABLE_B_IND1", false);
checkForIndex(dbDeployerAppContext, "TABLE_C", "TABLE_C_IND1", false);
dbDeployerAppContext.deploy(new MainDeployerArgs().changesetNames(Sets.immutable.with("phaseA")));
checkForIndex(dbDeployerAppContext, "TABLE_A", "TABLE_A_IND1", true);
checkForIndex(dbDeployerAppContext, "TABLE_B", "TABLE_B_IND1", true);
checkForIndex(dbDeployerAppContext, "TABLE_C", "TABLE_C_IND1", false);
dbDeployerAppContext.deploy(new MainDeployerArgs().changesetNames(Sets.immutable.with("phaseB")));
checkForIndex(dbDeployerAppContext, "TABLE_A", "TABLE_A_IND1", true);
checkForIndex(dbDeployerAppContext, "TABLE_B", "TABLE_B_IND1", true);
checkForIndex(dbDeployerAppContext, "TABLE_C", "TABLE_C_IND1", true);
}