Skip to content

Commit f5d49f6

Browse files
committed
chore(spanner): INVALID_ARGUMENT error code to NOT_FOUND
1 parent 35d065c commit f5d49f6

File tree

2 files changed

+3
-24
lines changed

2 files changed

+3
-24
lines changed

google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITTransactionManagerAsyncTest.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,7 @@ public void testInvalidInsert() throws InterruptedException {
161161
} catch (ExecutionException e) {
162162
assertThat(e.getCause()).isInstanceOf(SpannerException.class);
163163
SpannerException se = (SpannerException) e.getCause();
164-
if (env.getTestHelper()
165-
.getOptions()
166-
.getSessionPoolOptions()
167-
.getUseMultiplexedSessionForRW()) {
168-
assertThat(se.getErrorCode()).isEqualTo(ErrorCode.INVALID_ARGUMENT);
169-
} else {
170-
assertThat(se.getErrorCode()).isEqualTo(ErrorCode.NOT_FOUND);
171-
}
164+
assertThat(se.getErrorCode()).isEqualTo(ErrorCode.NOT_FOUND);
172165
// expected
173166
break;
174167
}

google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITWriteTest.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,14 +1043,7 @@ public void tableNotFound() {
10431043
.build());
10441044
fail("Expected exception");
10451045
} catch (SpannerException ex) {
1046-
if (env.getTestHelper()
1047-
.getOptions()
1048-
.getSessionPoolOptions()
1049-
.getUseMultiplexedSessionForRW()) {
1050-
assertThat(ex.getErrorCode()).isEqualTo(ErrorCode.INVALID_ARGUMENT);
1051-
} else {
1052-
assertThat(ex.getErrorCode()).isEqualTo(ErrorCode.NOT_FOUND);
1053-
}
1046+
assertThat(ex.getErrorCode()).isEqualTo(ErrorCode.NOT_FOUND);
10541047
}
10551048
}
10561049

@@ -1060,14 +1053,7 @@ public void columnNotFound() {
10601053
write(baseInsert().set("ColumnThatDoesNotExist").to("V1").build());
10611054
fail("Expected exception");
10621055
} catch (SpannerException ex) {
1063-
if (env.getTestHelper()
1064-
.getOptions()
1065-
.getSessionPoolOptions()
1066-
.getUseMultiplexedSessionForRW()) {
1067-
assertThat(ex.getErrorCode()).isEqualTo(ErrorCode.INVALID_ARGUMENT);
1068-
} else {
1069-
assertThat(ex.getErrorCode()).isEqualTo(ErrorCode.NOT_FOUND);
1070-
}
1056+
assertThat(ex.getErrorCode()).isEqualTo(ErrorCode.NOT_FOUND);
10711057
}
10721058
}
10731059

0 commit comments

Comments
 (0)