|
2 | 2 |
|
3 | 3 | import static org.hamcrest.MatcherAssert.assertThat; |
4 | 4 | import static org.hamcrest.Matchers.containsString; |
| 5 | +import static org.hamcrest.Matchers.greaterThan; |
5 | 6 | import static org.hamcrest.Matchers.hasItem; |
6 | 7 | import static org.hamcrest.Matchers.is; |
| 8 | +import static org.hamcrest.Matchers.not; |
| 9 | +import static org.hamcrest.Matchers.startsWith; |
7 | 10 | import static org.hamcrest.io.FileMatchers.anExistingFile; |
8 | 11 | import static org.jenkinsci.plugins.gitclient.verifier.KnownHostsTestUtil.runKnownHostsTests; |
9 | 12 | import static org.junit.jupiter.api.Assumptions.assumeTrue; |
@@ -161,11 +164,11 @@ void testNewEntriesAreNotHashed() throws Exception { |
161 | 164 |
|
162 | 165 | // The key insight: entries should be in plain format like "github.com,140.82.121.4 ssh-ed25519 ..." |
163 | 166 | // NOT hashed like "|1|hash|hash ssh-ed25519 ..." |
164 | | - assertThat("At least one entry should be created", nonEmptyLines.size() >= 1, is(true)); |
| 167 | + assertThat("At least one entry should be created", nonEmptyLines.size(), is(greaterThan(0))); |
165 | 168 |
|
166 | 169 | // Verify ALL entries are NOT hashed (no |1| prefix indicating hashed hostname) |
167 | 170 | for (String entry : nonEmptyLines) { |
168 | | - assertThat("Entry should not start with |1| (hashed format): " + entry, entry.startsWith("|1|"), is(false)); |
| 171 | + assertThat("Entry should not start with |1| (hashed format): " + entry, entry, not(startsWith("|1|"))); |
169 | 172 |
|
170 | 173 | // Verify it contains the key type |
171 | 174 | assertThat("Entry should contain key type: " + entry, entry, containsString("ssh-ed25519")); |
|
0 commit comments