Skip to content

Commit 00380da

Browse files
cpovirkkolea2
authored andcommitted
Migrate from containsAllIn to containsAtLeastElementsIn. (#5042)
The two behave identically, and containsAllIn is being removed. The new method was added in Truth 0.44, so update to that. That requires a migration from the removed ThrowableSubject.hasMessage(...) to hasMessageThat().isEqualTo(...). And to preserve RequireUpperBoundDeps, also update checker-compat-qual to 2.5.5.
1 parent 75a5beb commit 00380da

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

google-cloud-clients/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserverTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ public void push(String response) {
335335
innerCallable.call("request", middleware);
336336

337337
Truth.assertThat(outerObserver.getFinalError()).isInstanceOf(IllegalStateException.class);
338-
Truth.assertThat(outerObserver.getFinalError()).hasMessage("fake error");
338+
Truth.assertThat(outerObserver.getFinalError()).hasMessageThat().isEqualTo("fake error");
339339
Truth.assertThat(outerObserver.popNextResponse()).isEqualTo("a");
340340
Truth.assertThat(outerObserver.popNextResponse()).isNull();
341341
}
@@ -365,7 +365,7 @@ public String pop() {
365365
StreamControllerStash<String> lastCall = innerCallable.popLastCall();
366366

367367
Truth.assertThat(outerObserver.getFinalError()).isInstanceOf(IllegalStateException.class);
368-
Truth.assertThat(outerObserver.getFinalError()).hasMessage("fake error");
368+
Truth.assertThat(outerObserver.getFinalError()).hasMessageThat().isEqualTo("fake error");
369369
Truth.assertThat(outerObserver.popNextResponse()).isEqualTo("a");
370370
Truth.assertThat(outerObserver.popNextResponse()).isNull();
371371
Truth.assertThat(popCount.get()).isEqualTo(2);

google-cloud-clients/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDatabaseAdminTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,6 @@ public void listPagination() throws Exception {
171171
dbIdsGot.add(db.getId().getDatabase());
172172
page = page.getNextPage();
173173
}
174-
assertThat(dbIdsGot).containsAllIn(dbIds);
174+
assertThat(dbIdsGot).containsAtLeastElementsIn(dbIds);
175175
}
176176
}

google-cloud-clients/google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITTransactionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public void run() {
138138
for (int i = 0; i < numThreads; ++i) {
139139
expectedResults.add(i + 1L);
140140
}
141-
assertThat(results).containsAllIn(expectedResults);
141+
assertThat(results).containsAtLeastElementsIn(expectedResults);
142142
assertThat(Sets.newHashSet(commitTimestamps)).hasSize(numThreads);
143143

144144
assertThat(

google-cloud-clients/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,12 +408,12 @@
408408
<dependency>
409409
<groupId>com.google.truth</groupId>
410410
<artifactId>truth</artifactId>
411-
<version>0.42</version>
411+
<version>0.44</version>
412412
</dependency>
413413
<dependency>
414414
<groupId>org.checkerframework</groupId>
415415
<artifactId>checker-compat-qual</artifactId>
416-
<version>2.5.3</version>
416+
<version>2.5.5</version>
417417
</dependency>
418418
</dependencies>
419419
</dependencyManagement>

0 commit comments

Comments
 (0)