File tree Expand file tree Collapse file tree
google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616package com .google .cloud .bigtable .data .v2 .stub ;
1717
1818import static com .google .common .truth .Truth .assertThat ;
19+ import static org .junit .Assert .assertThrows ;
1920
2021import com .google .api .core .ApiFunction ;
2122import 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 {
You can’t perform that action at this time.
0 commit comments