diff options
author | Florian Zschocke <fzs@users.noreply.github.com> | 2016-12-18 17:01:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-18 17:01:15 +0100 |
commit | d6ddafdb24ea55e59ac718b92f4b74e3b825ca63 (patch) | |
tree | e029423f37eb109a123f8d9fc267d6638fa1be59 /src/test/java/com/gitblit/tests/SshKeysDispatcherTest.java | |
parent | 34b98a07b8f01015ddbafd4bdaad0458c25765ae (diff) | |
parent | 1afeccc09bfaa885b5c01d3db29d42695b8290a1 (diff) | |
download | gitblit-d6ddafdb24ea55e59ac718b92f4b74e3b825ca63.tar.gz gitblit-d6ddafdb24ea55e59ac718b92f4b74e3b825ca63.zip |
Merge pull request #1160 from fzs/sshLdapAuthenticator
LDAP SSH key manager
Diffstat (limited to 'src/test/java/com/gitblit/tests/SshKeysDispatcherTest.java')
-rw-r--r-- | src/test/java/com/gitblit/tests/SshKeysDispatcherTest.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/test/java/com/gitblit/tests/SshKeysDispatcherTest.java b/src/test/java/com/gitblit/tests/SshKeysDispatcherTest.java index 23e61795..4784e468 100644 --- a/src/test/java/com/gitblit/tests/SshKeysDispatcherTest.java +++ b/src/test/java/com/gitblit/tests/SshKeysDispatcherTest.java @@ -37,7 +37,7 @@ public class SshKeysDispatcherTest extends SshUnitTest { String result = testSshCommand("keys ls -L"); List<SshKey> keys = getKeyManager().getKeys(username); assertEquals(String.format("There are %d keys!", keys.size()), 2, keys.size()); - assertEquals(keys.get(0).getRawData() + "\n" + keys.get(1).getRawData(), result); + assertEquals(String.format("%s%n%s", keys.get(0).getRawData(), keys.get(1).getRawData()), result); } @Test @@ -64,9 +64,9 @@ public class SshKeysDispatcherTest extends SshUnitTest { assertEquals(String.format("There are %d keys!", keys.size()), 0, keys.size()); try { testSshCommand("keys ls -L"); - assertTrue("Authentication worked without a public key?!", false); + fail("Authentication worked without a public key?!"); } catch (AssertionError e) { - assertTrue(true); + // expected } } @@ -77,9 +77,9 @@ public class SshKeysDispatcherTest extends SshUnitTest { assertEquals(String.format("There are %d keys!", keys.size()), 0, keys.size()); try { testSshCommand("keys ls -L"); - assertTrue("Authentication worked without a public key?!", false); + fail("Authentication worked without a public key?!"); } catch (AssertionError e) { - assertTrue(true); + // expected } } @@ -96,9 +96,9 @@ public class SshKeysDispatcherTest extends SshUnitTest { StringBuilder sb = new StringBuilder(); for (SshKey sk : keys) { sb.append(sk.getRawData()); - sb.append('\n'); + sb.append(System.getProperty("line.separator", "\n")); } - sb.setLength(sb.length() - 1); + sb.setLength(sb.length() - System.getProperty("line.separator", "\n").length()); assertEquals(sb.toString(), result); } |