|
@@ -117,6 +117,9 @@ public class WLGitBridgeIntegrationTest {
|
|
|
put("pushSubmoduleFailsWithInvalidGitRepo", new HashMap<String, SnapshotAPIState>() {{
|
|
put("pushSubmoduleFailsWithInvalidGitRepo", new HashMap<String, SnapshotAPIState>() {{
|
|
|
put("state", new SnapshotAPIStateBuilder(getResourceAsStream("/pushSubmoduleFailsWithInvalidGitRepo/state/state.json")).build());
|
|
put("state", new SnapshotAPIStateBuilder(getResourceAsStream("/pushSubmoduleFailsWithInvalidGitRepo/state/state.json")).build());
|
|
|
}});
|
|
}});
|
|
|
|
|
+ put("canMigrateRepository", new HashMap<String, SnapshotAPIState>() {{
|
|
|
|
|
+ put("state", new SnapshotAPIStateBuilder(getResourceAsStream("/canMigrateRepository/state/state.json")).build());
|
|
|
|
|
+ }});
|
|
|
}};
|
|
}};
|
|
|
|
|
|
|
|
@Rule
|
|
@Rule
|
|
@@ -787,6 +790,24 @@ public class WLGitBridgeIntegrationTest {
|
|
|
assertNotEquals(0, gitProcess.waitFor());
|
|
assertNotEquals(0, gitProcess.waitFor());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Test
|
|
|
|
|
+ public void canMigrateRepository() throws IOException, GitAPIException, InterruptedException {
|
|
|
|
|
+ int gitBridgePort = 33881;
|
|
|
|
|
+ int mockServerPort = 3881;
|
|
|
|
|
+ MockSnapshotServer server = new MockSnapshotServer(mockServerPort, getResource("/canMigrateRepository").toFile());
|
|
|
|
|
+ server.start();
|
|
|
|
|
+ server.setState(states.get("canMigrateRepository").get("state"));
|
|
|
|
|
+ GitBridgeApp wlgb = new GitBridgeApp(new String[] {
|
|
|
|
|
+ makeConfigFile(gitBridgePort, mockServerPort)
|
|
|
|
|
+ });
|
|
|
|
|
+ wlgb.run();
|
|
|
|
|
+ File testprojDir = gitClone("testproj", gitBridgePort, dir);
|
|
|
|
|
+ File testprojDir2 = gitClone("testproj2", gitBridgePort, dir);
|
|
|
|
|
+ wlgb.stop();
|
|
|
|
|
+
|
|
|
|
|
+ assertTrue(FileUtil.gitDirectoriesAreEqual(getResource("/canMigrateRepository/state/testproj"), testprojDir2.toPath()));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private String makeConfigFile(
|
|
private String makeConfigFile(
|
|
|
int port,
|
|
int port,
|
|
|
int apiPort
|
|
int apiPort
|