String remoteName2 = "myremote2";
String remoteURL2 = "http://test2.org";
String branch = "mybranch";
Remote remote = remoteAdd.setName(remoteName1).setURL(remoteURL1).call();
assertEquals(remoteName1, remote.getName());
assertEquals(remoteURL1, remote.getFetchURL());
assertEquals(remoteURL1, remote.getPushURL());
assertEquals("+refs/heads/*:refs/remotes/" + remoteName1 + "/*", remote.getFetch());
remote = remoteAdd.setName(remoteName2).setURL(remoteURL2).setBranch(branch).call();
assertEquals(remoteName2, remote.getName());
assertEquals(remoteURL2, remote.getFetchURL());
assertEquals(remoteURL2, remote.getPushURL());
assertEquals("+refs/heads/" + branch + ":refs/remotes/" + remoteName2 + "/" + branch,
remote.getFetch());
final RemoteListOp remoteList = geogig.command(RemoteListOp.class);
ImmutableList<Remote> allRemotes = remoteList.call();
assertEquals(2, allRemotes.size());
Remote firstRemote = allRemotes.get(0);
Remote secondRemote = allRemotes.get(1);
if (!firstRemote.getName().equals(remoteName1)) {
// swap first and second
Remote tempRemote = firstRemote;
firstRemote = secondRemote;
secondRemote = tempRemote;
}
assertEquals(remoteName1, firstRemote.getName());