Skip to content

Commit b4cf91a

Browse files
committed
minor change to test
Change-Id: I63f9f0e930f95d48ce56962e49d6bdca0fc5918d
1 parent 3dff3cd commit b4cf91a

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimerTest.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package com.google.cloud.bigtable.data.v2.stub;
1717

1818
import static com.google.common.truth.Truth.assertThat;
19+
import static org.junit.Assert.assertThrows;
1920

2021
import com.google.api.core.ApiFunction;
2122
import com.google.api.core.SettableApiFuture;
@@ -193,12 +194,9 @@ public PingAndWarmResponse apply(PingAndWarmRequest pingAndWarmRequest) {
193194

194195
SettableApiFuture<PingAndWarmResponse> future = primer.sendPrimeRequestsAsync(channel);
195196

196-
try {
197-
future.get(1, TimeUnit.SECONDS);
198-
} catch (Exception e) {
199-
// Assert that the future completes with an ExecutionException
200-
assertThat(e).isInstanceOf(ExecutionException.class);
201-
}
197+
ExecutionException e =
198+
assertThrows(ExecutionException.class, () -> future.get(1, TimeUnit.SECONDS));
199+
assertThat(e).hasCauseThat().hasMessageThat().contains("UNAVAILABLE");
202200
}
203201

204202
private static class MetadataInterceptor implements ServerInterceptor {

0 commit comments

Comments
 (0)