use of com.google.spanner.admin.instance.v1.GetInstanceConfigRequest in project java-spanner by googleapis.
the class InstanceAdminClientTest method getInstanceConfigTest.
@Test
public void getInstanceConfigTest() throws Exception {
InstanceConfig expectedResponse = InstanceConfig.newBuilder().setName(InstanceConfigName.of("[PROJECT]", "[INSTANCE_CONFIG]").toString()).setDisplayName("displayName1714148973").addAllReplicas(new ArrayList<ReplicaInfo>()).addAllLeaderOptions(new ArrayList<String>()).build();
mockInstanceAdmin.addResponse(expectedResponse);
InstanceConfigName name = InstanceConfigName.of("[PROJECT]", "[INSTANCE_CONFIG]");
InstanceConfig actualResponse = client.getInstanceConfig(name);
Assert.assertEquals(expectedResponse, actualResponse);
List<AbstractMessage> actualRequests = mockInstanceAdmin.getRequests();
Assert.assertEquals(1, actualRequests.size());
GetInstanceConfigRequest actualRequest = ((GetInstanceConfigRequest) actualRequests.get(0));
Assert.assertEquals(name.toString(), actualRequest.getName());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.spanner.admin.instance.v1.GetInstanceConfigRequest in project java-spanner by googleapis.
the class GapicSpannerRpc method getInstanceConfig.
@Override
public InstanceConfig getInstanceConfig(String instanceConfigName) throws SpannerException {
GetInstanceConfigRequest request = GetInstanceConfigRequest.newBuilder().setName(instanceConfigName).build();
GrpcCallContext context = newCallContext(null, projectName, request, InstanceAdminGrpc.getGetInstanceConfigMethod());
return get(instanceAdminStub.getInstanceConfigCallable().futureCall(request, context));
}
use of com.google.spanner.admin.instance.v1.GetInstanceConfigRequest in project java-spanner by googleapis.
the class InstanceAdminClientTest method getInstanceConfigTest2.
@Test
public void getInstanceConfigTest2() throws Exception {
InstanceConfig expectedResponse = InstanceConfig.newBuilder().setName(InstanceConfigName.of("[PROJECT]", "[INSTANCE_CONFIG]").toString()).setDisplayName("displayName1714148973").addAllReplicas(new ArrayList<ReplicaInfo>()).addAllLeaderOptions(new ArrayList<String>()).build();
mockInstanceAdmin.addResponse(expectedResponse);
String name = "name3373707";
InstanceConfig actualResponse = client.getInstanceConfig(name);
Assert.assertEquals(expectedResponse, actualResponse);
List<AbstractMessage> actualRequests = mockInstanceAdmin.getRequests();
Assert.assertEquals(1, actualRequests.size());
GetInstanceConfigRequest actualRequest = ((GetInstanceConfigRequest) actualRequests.get(0));
Assert.assertEquals(name, actualRequest.getName());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Aggregations