diff options
author | ankitbhatt <ankit.bhatt@amdocs.com> | 2019-09-06 17:06:32 +0530 |
---|---|---|
committer | ankitbhatt <ankit.bhatt@amdocs.com> | 2019-09-06 17:07:06 +0530 |
commit | 949046b14b13cbe52b7ad3aca7cd6aaf7d4c7038 (patch) | |
tree | 1b4d167591c3e2400e3e8082725ca649471ecd43 /src/test/java/org | |
parent | 3f8f4a735fe4051f4ed234083028d78994a29051 (diff) |
fixed issue with --rundisabled flag
also fixed issues for picking up the migrators without having migrator priority flag
Issue-ID: AAI-2387
Signed-off-by: Ankit Bhatt <ankit.bhatt@amdocs.com>
Change-Id: I992eea15299cbe10af5196e795f68d4a4b4d21b3
Diffstat (limited to 'src/test/java/org')
-rw-r--r-- | src/test/java/org/onap/aai/migration/MigrationControllerInternalTest.java | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/src/test/java/org/onap/aai/migration/MigrationControllerInternalTest.java b/src/test/java/org/onap/aai/migration/MigrationControllerInternalTest.java index 8e9f88f..215dd55 100644 --- a/src/test/java/org/onap/aai/migration/MigrationControllerInternalTest.java +++ b/src/test/java/org/onap/aai/migration/MigrationControllerInternalTest.java @@ -242,7 +242,29 @@ public class MigrationControllerInternalTest extends AAISetup { System.setOut(new PrintStream(myOut)); String [] args = { "-c", "./bundleconfig-local/etc/appprops/janusgraph-realtime.properties", - "-m", "SDWANSpeedChangeMigration", + "-m", "MigrateBooleanDefaultsToFalse", + " --skipPreMigrationSnapShot", + "--commit", + "--runDisabled","RebuildAllEdges", + "-f" + }; + migrationControllerInternal.run(args); + String content = myOut.toString(); + assertThat("RebuildAllEdges didn't run", content.contains("igration RebuildAllEdges Succeeded.")); + assertThat("MigrateBooleanDefaultsToFalse didn't run", content.contains("igration MigrateBooleanDefaultsToFalse Succeeded.")); + System.setOut(oldOutputStream); + } + + @Test + public void testSkipSpecificMigrationWithRunDisabledAndCommit() throws Exception { + assertThat("rebuildAllEdges shouldn't have enabled annotation", !RebuildAllEdges.class.isAnnotationPresent(Enabled.class)); + PrintStream oldOutputStream = System.out; + final ByteArrayOutputStream myOut = new ByteArrayOutputStream(); + System.setOut(new PrintStream(myOut)); + String [] args = { + "-c", "./bundleconfig-local/etc/appprops/janusgraph-realtime.properties", + "-e", "MigrateRadcomChanges", + "--skipPreMigrationSnapShot", "--commit", "--runDisabled","RebuildAllEdges", "-f" @@ -250,7 +272,9 @@ public class MigrationControllerInternalTest extends AAISetup { migrationControllerInternal.run(args); String content = myOut.toString(); assertThat("RebuildAllEdges didn't run", content.contains("igration RebuildAllEdges Succeeded.")); - assertThat("SDWANSpeedChangeMigration shouldn't run", !content.contains("igration SDWANSpeedChangeMigration Succeeded.")); + //all other mirgrators should run along with rebuild edges. + assertThat("MigrateBooleanDefaultsToFalse didn't run", content.contains("igration MigrateBooleanDefaultsToFalse Succeeded.")); + assertThat("MigrateRadcomChanges shouldn't run", !content.contains("igration MigrateRadcomChanges Succeeded.")); System.setOut(oldOutputStream); } @@ -262,8 +286,10 @@ public class MigrationControllerInternalTest extends AAISetup { System.setOut(new PrintStream(myOut)); String [] args = { "-c", "./bundleconfig-local/etc/appprops/janusgraph-realtime.properties", + "--skipPreMigrationSnapShot", "--commit", - "--runDisabled","RebuildAllEdges" + "--runDisabled","RebuildAllEdges", + "-f" }; migrationControllerInternal.run(args); String content = myOut.toString(); @@ -282,7 +308,8 @@ public class MigrationControllerInternalTest extends AAISetup { "-c", "./bundleconfig-local/etc/appprops/janusgraph-realtime.properties", "--commit", "--runDisabled","RebuildAllEdges", - "-e","RebuildAllEdges" + "-e","RebuildAllEdges", + "-f" }; migrationControllerInternal.run(args); String content = myOut.toString(); |