Skip to content

Commit ea828f9

Browse files
committed
Use assertThat
1 parent 8ca01de commit ea828f9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

server/src/internalClusterTest/java/org/elasticsearch/snapshots/GetSnapshotsIT.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
import static org.elasticsearch.repositories.blobstore.BlobStoreRepository.getRepositoryDataBlobName;
7272
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
7373
import static org.hamcrest.Matchers.empty;
74+
import static org.hamcrest.Matchers.hasItem;
7475
import static org.hamcrest.Matchers.hasSize;
7576
import static org.hamcrest.Matchers.in;
7677
import static org.hamcrest.Matchers.is;
@@ -672,8 +673,8 @@ public void testFilterByState() throws Exception {
672673
snapshots = getSnapshotsForStates.apply(EnumSet.of(SnapshotState.SUCCESS, SnapshotState.IN_PROGRESS));
673674
assertThat(snapshots, hasSize(2));
674675
var states = snapshots.stream().map(SnapshotInfo::state).collect(Collectors.toSet());
675-
assertTrue(states.contains(SnapshotState.SUCCESS));
676-
assertTrue(states.contains(SnapshotState.IN_PROGRESS));
676+
assertThat(states, hasItem(SnapshotState.SUCCESS));
677+
assertThat(states, hasItem(SnapshotState.IN_PROGRESS));
677678

678679
// Fetch all snapshots (without state)
679680
snapshots = clusterAdmin().prepareGetSnapshots(TEST_REQUEST_TIMEOUT, repoName).get().getSnapshots();

0 commit comments

Comments
 (0)