Commit e4f3884
committed
Replace deprecated match methods
diff --git a/docker-java/src/test/java/com/github/dockerjava/cmd/ListContainersCmdIT.java b/docker-java/src/test/java/com/github/dockerjava/cmd/ListContainersCmdIT.java
index c03df2a..3066767 100644
--- a/docker-java/src/test/java/com/github/dockerjava/cmd/ListContainersCmdIT.java
+++ b/docker-java/src/test/java/com/github/dockerjava/cmd/ListContainersCmdIT.java
@@ -26,11 +26,12 @@ import static java.util.Collections.singletonList;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItem;
+import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.emptyString;
-import static org.hamcrest.Matchers.isOneOf;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.notNullValue;
+import static org.hamcrest.Matchers.oneOf;
import static org.hamcrest.Matchers.startsWith;
import static org.junit.Assert.assertEquals;
import static org.testinfected.hamcrest.jpa.PersistenceMatchers.hasField;
@@ -161,8 +162,8 @@ public class ListContainersCmdIT extends CmdIT {
.exec();
assertThat(filteredContainers.size(), is(2));
- assertThat(filteredContainers.get(0).getId(), isOneOf(id1, id2));
- assertThat(filteredContainers.get(1).getId(), isOneOf(id1, id2));
+ assertThat(filteredContainers.get(0).getId(), is(oneOf(id1, id2)));
+ assertThat(filteredContainers.get(1).getId(), is(oneOf(id1, id2)));
}
@test
@@ -184,8 +185,8 @@ public class ListContainersCmdIT extends CmdIT {
.exec();
assertThat(filteredContainers.size(), is(2));
- assertThat(filteredContainers.get(0).getId(), isOneOf(id1, id2));
- assertThat(filteredContainers.get(1).getId(), isOneOf(id1, id2));
+ assertThat(filteredContainers.get(0).getId(), is(oneOf(id1, id2)));
+ assertThat(filteredContainers.get(1).getId(), is(oneOf(id1, id2)));
}
@test
@@ -219,7 +220,7 @@ public class ListContainersCmdIT extends CmdIT {
.withStatusFilter(singletonList("running"))
.exec();
- assertThat(filteredContainers.size(), is(1));
+ assertThat(filteredContainers, hasSize(1));
assertThat(filteredContainers.get(0).getId(), is(containerId));
}
@@ -239,7 +240,7 @@ public class ListContainersCmdIT extends CmdIT {
.withStatusFilter(singletonList("paused"))
.exec();
- assertThat(filteredContainers.size(), is(1));
+ assertThat(filteredContainers, hasSize(1));
assertThat(filteredContainers.get(0).getId(), is(containerId));
}
@@ -260,7 +261,7 @@ public class ListContainersCmdIT extends CmdIT {
.withStatusFilter(singletonList("exited"))
.exec();
- assertThat(filteredContainers.size(), is(1));
+ assertThat(filteredContainers, hasSize(1));
assertThat(filteredContainers.get(0).getId(), is(containerId));
}
@@ -289,7 +290,7 @@ public class ListContainersCmdIT extends CmdIT {
.withVolumeFilter(singletonList("TestFilterVolume"))
.exec();
- assertThat(filteredContainers.size(), is(1));
+ assertThat(filteredContainers, hasSize(1));
assertThat(filteredContainers.get(0).getId(), is(id));
}1 parent 8a84051 commit e4f3884
File tree
1 file changed
+10
-9
lines changed- docker-java/src/test/java/com/github/dockerjava/cmd
1 file changed
+10
-9
lines changedLines changed: 10 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
164 | | - | |
165 | | - | |
| 165 | + | |
| 166 | + | |
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
| |||
184 | 185 | | |
185 | 186 | | |
186 | 187 | | |
187 | | - | |
188 | | - | |
| 188 | + | |
| 189 | + | |
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
| |||
219 | 220 | | |
220 | 221 | | |
221 | 222 | | |
222 | | - | |
| 223 | + | |
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
| |||
239 | 240 | | |
240 | 241 | | |
241 | 242 | | |
242 | | - | |
| 243 | + | |
243 | 244 | | |
244 | 245 | | |
245 | 246 | | |
| |||
260 | 261 | | |
261 | 262 | | |
262 | 263 | | |
263 | | - | |
| 264 | + | |
264 | 265 | | |
265 | 266 | | |
266 | 267 | | |
| |||
289 | 290 | | |
290 | 291 | | |
291 | 292 | | |
292 | | - | |
| 293 | + | |
293 | 294 | | |
294 | 295 | | |
295 | 296 | | |
| |||
0 commit comments