Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1408,6 +1408,14 @@ private static <T> T get(final Future<T> future) throws SpannerException {
}
}

// Before removing this method, please verify with a code owner that it is not used
// in any internal testing infrastructure.
@VisibleForTesting
@Deprecated
GrpcCallContext newCallContext(@Nullable Map<Option, ?> options, String resource) {
return newCallContext(options, resource, null, null);
}

@VisibleForTesting
<ReqT, RespT> GrpcCallContext newCallContext(
@Nullable Map<Option, ?> options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
/** Tests that opening and closing multiple Spanner instances does not leak any threads. */
@RunWith(JUnit4.class)
public class GapicSpannerRpcTest {

private static final Statement SELECT1AND2 =
Statement.of("SELECT 1 AS COL1 UNION ALL SELECT 2 AS COL1");
private static final ResultSetMetadata SELECT1AND2_METADATA =
Expand Down Expand Up @@ -380,6 +381,7 @@ public void testNoCallCredentials() {
}

private static final class TimeoutHolder {

private Duration timeout;
}

Expand Down Expand Up @@ -454,6 +456,14 @@ public Long run(TransactionContext transaction) throws Exception {
}
}

@Test
public void testNewCallContextWithNullRequestAndNullMethod() {
SpannerOptions options = SpannerOptions.newBuilder().setProjectId("some-project").build();
GapicSpannerRpc rpc = new GapicSpannerRpc(options);
assertThat(rpc.newCallContext(optionsMap, "/some/resource", null, null)).isNotNull();
rpc.shutdown();
}

@SuppressWarnings("rawtypes")
private SpannerOptions createSpannerOptions() {
String endpoint = address.getHostString() + ":" + server.getPort();
Expand Down