Skip to content

Commit 2ddc35a

Browse files
committed
Relax the log check
1 parent fc513f0 commit 2ddc35a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/test/java/org/jenkinsci/plugins/scriptsecurity/scripts/HasherScriptApprovalTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import static org.hamcrest.Matchers.containsInAnyOrder;
1919
import static org.hamcrest.Matchers.containsInRelativeOrder;
2020
import static org.hamcrest.Matchers.containsString;
21+
import static org.hamcrest.Matchers.hasItem;
2122
import static org.hamcrest.Matchers.not;
2223
import static org.junit.Assert.assertEquals;
2324
import static org.junit.Assert.assertTrue;
@@ -51,7 +52,7 @@ public void warnsAndClearsDeprecatedScriptHashes() throws Throwable {
5152
session.then(r -> {
5253
final ScriptApproval approval = ScriptApproval.get();
5354
assertEquals(2, approval.countDeprecatedApprovedScriptHashes());
54-
assertThat(log.getMessages(), containsInAnyOrder(
55+
assertThat(log.getMessages(), hasItem(
5556
containsString("There are 2 deprecated approved script hashes " +
5657
"and 0 deprecated approved classpath hashes.")));
5758
approval.clearDeprecatedApprovedScripts();
@@ -102,7 +103,7 @@ public void testConvertApprovedClasspathEntries() throws Throwable {
102103
final ScriptApproval approval = ScriptApproval.get();
103104
assertEquals(2, approval.countDeprecatedApprovedClasspathHashes());
104105

105-
assertThat(log.getMessages(), containsInAnyOrder(
106+
assertThat(log.getMessages(), hasItem(
106107
containsString("There are 0 deprecated approved script hashes " +
107108
"and 2 deprecated approved classpath hashes.")));
108109

0 commit comments

Comments
 (0)