use of jetbrains.buildServer.ssh.TeamCitySshKey in project teamcity-git by JetBrains.
the class GitUrlSupportTest method scp_syntax_use_uploaded_key.
@Test
public void scp_syntax_use_uploaded_key() throws Exception {
VcsUrl url = new VcsUrl("git@github.com:user/repo.git");
myTestKeys.add(new TeamCitySshKey("key1", new byte[0], true));
myTestKeys.add(new TeamCitySshKey("key2", new byte[0], false));
// Mock vcsRoot = mock(SVcsRoot.class);
// myProjectMock.expects(once()).method("createDummyVcsRoot").with(eq(Constants.VCS_NAME), mapContaining(VcsRootSshKeyManager.VCS_ROOT_TEAMCITY_SSH_KEY_NAME, "key2")).will(returnValue(vcsRoot.proxy()));
myTestConnectionMocked = true;
GitVcsRoot root = toGitRoot(url);
assertEquals(AuthenticationMethod.TEAMCITY_SSH_KEY, root.getAuthSettings().getAuthMethod());
assertEquals("key2", root.getAuthSettings().getTeamCitySshKeyId());
assertEquals("git", root.getAuthSettings().toMap().get(Constants.USERNAME));
}
Aggregations