File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
google-cloud-spanner/src/test/java/com/google/cloud/spanner/it Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 47
47
import java .util .Optional ;
48
48
import java .util .concurrent .ExecutionException ;
49
49
import java .util .concurrent .TimeUnit ;
50
+ import java .util .concurrent .TimeoutException ;
50
51
import java .util .logging .Level ;
51
52
import java .util .logging .Logger ;
53
+ import org .junit .Assert ;
52
54
import org .junit .Before ;
53
55
import org .junit .ClassRule ;
54
56
import org .junit .Test ;
@@ -260,9 +262,14 @@ public void updateDatabaseInvalidFieldsToUpdate() {
260
262
OperationFuture <Database , UpdateDatabaseMetadata > op =
261
263
dbAdminClient .updateDatabase (databaseToUpdate );
262
264
263
- ExecutionException e =
264
- assertThrows (ExecutionException .class , () -> op .get (5 , TimeUnit .MINUTES ));
265
- assertThat (e .getMessage ()).contains ("Invalid field mask" );
265
+ try {
266
+ op .get (5 , TimeUnit .MINUTES );
267
+ Assert .fail ("No exception thrown" );
268
+ } catch (ExecutionException | InterruptedException | TimeoutException e ) {
269
+ Assert .assertTrue (e .getCause () instanceof SpannerException );
270
+ SpannerException exception = ((SpannerException ) e .getCause ());
271
+ assertEquals (ErrorCode .INVALID_ARGUMENT , exception .getErrorCode ());
272
+ }
266
273
}
267
274
268
275
@ Test
Original file line number Diff line number Diff line change 25
25
excludes = [
26
26
".kokoro/continuous/common.cfg" ,
27
27
".kokoro/nightly/common.cfg" ,
28
+ ".kokoro/nightly/integration.cfg" ,
28
29
".kokoro/nightly/java8-samples.cfg" ,
29
30
".kokoro/nightly/java11-samples.cfg" ,
30
31
".kokoro/nightly/samples.cfg" ,
You can’t perform that action at this time.
0 commit comments