|
|
@@ -120,6 +120,9 @@ public class WLGitBridgeIntegrationTest {
|
|
|
put("canMigrateRepository", new HashMap<String, SnapshotAPIState>() {{
|
|
|
put("state", new SnapshotAPIStateBuilder(getResourceAsStream("/canMigrateRepository/state/state.json")).build());
|
|
|
}});
|
|
|
+ put("skipMigrationWhenMigratedFromMissing", new HashMap<String, SnapshotAPIState>() {{
|
|
|
+ put("state", new SnapshotAPIStateBuilder(getResourceAsStream("/skipMigrationWhenMigratedFromMissing/state/state.json")).build());
|
|
|
+ }});
|
|
|
}};
|
|
|
|
|
|
@Rule
|
|
|
@@ -805,9 +808,28 @@ public class WLGitBridgeIntegrationTest {
|
|
|
File testprojDir2 = gitClone("testproj2", gitBridgePort, dir);
|
|
|
wlgb.stop();
|
|
|
|
|
|
+ // Second project content is equal to content of the first
|
|
|
assertTrue(FileUtil.gitDirectoriesAreEqual(getResource("/canMigrateRepository/state/testproj"), testprojDir2.toPath()));
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ public void skipMigrationWhenMigratedFromMissing() throws IOException, GitAPIException, InterruptedException {
|
|
|
+ int gitBridgePort = 33882;
|
|
|
+ int mockServerPort = 3882;
|
|
|
+ MockSnapshotServer server = new MockSnapshotServer(mockServerPort, getResource("/skipMigrationWhenMigratedFromMissing").toFile());
|
|
|
+ server.start();
|
|
|
+ server.setState(states.get("skipMigrationWhenMigratedFromMissing").get("state"));
|
|
|
+ GitBridgeApp wlgb = new GitBridgeApp(new String[] {
|
|
|
+ makeConfigFile(gitBridgePort, mockServerPort)
|
|
|
+ });
|
|
|
+ wlgb.run();
|
|
|
+ // don't clone the source project first
|
|
|
+ File testprojDir2 = gitClone("testproj2", gitBridgePort, dir);
|
|
|
+ wlgb.stop();
|
|
|
+
|
|
|
+ assertTrue(FileUtil.gitDirectoriesAreEqual(getResource("/skipMigrationWhenMigratedFromMissing/state/testproj2"), testprojDir2.toPath()));
|
|
|
+ }
|
|
|
+
|
|
|
private String makeConfigFile(
|
|
|
int port,
|
|
|
int apiPort
|