Skip to content

Commit b1093eb

Browse files
committed
Merge branch 'master' of https://github.com/jenkinsci/support-core-plugin into generate-support-bundle-async
2 parents 8bdbb2b + 18abe6f commit b1093eb

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<parent>
2929
<groupId>org.jenkins-ci.plugins</groupId>
3030
<artifactId>plugin</artifactId>
31-
<version>5.2</version>
31+
<version>5.7</version>
3232
<relativePath />
3333
</parent>
3434

src/test/java/com/cloudbees/jenkins/support/impl/NodeRemoteDirectoryComponentTest.java

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package com.cloudbees.jenkins.support.impl;
22

3-
import static org.junit.Assert.assertFalse;
4-
import static org.junit.Assert.assertTrue;
3+
import static org.hamcrest.MatcherAssert.assertThat;
4+
import static org.hamcrest.Matchers.hasItem;
5+
import static org.hamcrest.Matchers.not;
6+
import static org.hamcrest.text.MatchesPattern.matchesPattern;
57

68
import com.cloudbees.jenkins.support.SupportTestUtils;
79
import hudson.model.Label;
@@ -30,7 +32,7 @@ public void addContents() throws Exception {
3032
SupportTestUtils.invokeComponentToMap(new NodeRemoteDirectoryComponent(), agent.toComputer());
3133

3234
String prefix = "nodes/slave/" + agent.getNodeName() + "/remote";
33-
assertTrue(output.keySet().stream().anyMatch(key -> key.matches(prefix + "/support/.*.log")));
35+
assertThat(output.keySet(), hasItem(matchesPattern(prefix + "/support/.*.log")));
3436
}
3537

3638
/*
@@ -46,7 +48,7 @@ public void addContentsWithExcludes() throws Exception {
4648
new NodeRemoteDirectoryComponent("", "**/*.log", true, 10), agent.toComputer());
4749

4850
String prefix = "nodes/slave/" + agent.getNodeName() + "/remote";
49-
assertFalse(output.keySet().stream().anyMatch(key -> key.matches(prefix + ".*/.*.log")));
51+
assertThat(output.keySet(), not(hasItem(matchesPattern(prefix + ".*/.*.log"))));
5052
}
5153

5254
/*
@@ -62,7 +64,7 @@ public void addContentsWithIncludes() throws Exception {
6264
new NodeRemoteDirectoryComponent("support/*.log", "", true, 10), agent.toComputer());
6365

6466
String prefix = "nodes/slave/" + agent.getNodeName() + "/remote";
65-
assertTrue(output.keySet().stream().anyMatch(key -> key.matches(prefix + "/support/.*.log")));
67+
assertThat(output.keySet(), hasItem(matchesPattern(prefix + "/support/.*.log")));
6668
}
6769

6870
/*
@@ -78,6 +80,6 @@ public void addContentsWithMaxDepth() throws Exception {
7880
new NodeRemoteDirectoryComponent("", "", true, 1), agent.toComputer());
7981

8082
String prefix = "nodes/slave/" + agent.getNodeName() + "/remote";
81-
assertFalse(output.keySet().stream().anyMatch(key -> key.matches(prefix + "/support/.*.log")));
83+
assertThat(output.keySet(), not(hasItem(matchesPattern(prefix + "/support/.*.log"))));
8284
}
8385
}

0 commit comments

Comments
 (0)