fixing tests
authorPavel Sher <pavel.sher@gmail.com>
Sat, 23 Nov 2013 11:57:57 +0000 (12:57 +0100)
committerPavel Sher <pavel.sher@gmail.com>
Sat, 23 Nov 2013 11:57:57 +0000 (12:57 +0100)
git-tests/src/jetbrains/buildServer/buildTriggers/vcs/git/tests/GitUrlSupportTest.java

index 19e25df0eabc59e8348cc57f5f9c262a163c9de8..8c04f6d37d9fee0a64213e325e16301687176202 100644 (file)
@@ -122,7 +122,9 @@ public class GitUrlSupportTest extends BaseTestCase {
     if (url.getProviderSpecificPart().startsWith("ssh")) {
       assertEquals(AuthenticationMethod.PRIVATE_KEY_DEFAULT, root.getAuthSettings().getAuthMethod());
       assertTrue(root.getAuthSettings().isIgnoreKnownHosts());
-      assertEquals(url.getCredentials().getUsername(), root.getAuthSettings().toMap().get(Constants.USERNAME));
+      if (url.getCredentials() != null) {
+        assertEquals(url.getCredentials().getUsername(), root.getAuthSettings().toMap().get(Constants.USERNAME));
+      }
       assertNull(root.getAuthSettings().toMap().get(Constants.PASSWORD));
     } else {
       if (url.getCredentials() != null &&