Search in sources :

Example 11 with DeleteInstanceRequest

use of com.google.spanner.admin.instance.v1.DeleteInstanceRequest in project java-spanner by googleapis.

the class InstanceAdminClientTest method deleteInstanceTest2.

@Test
public void deleteInstanceTest2() throws Exception {
    Empty expectedResponse = Empty.newBuilder().build();
    mockInstanceAdmin.addResponse(expectedResponse);
    String name = "name3373707";
    client.deleteInstance(name);
    List<AbstractMessage> actualRequests = mockInstanceAdmin.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    DeleteInstanceRequest actualRequest = ((DeleteInstanceRequest) actualRequests.get(0));
    Assert.assertEquals(name, actualRequest.getName());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : Empty(com.google.protobuf.Empty) AbstractMessage(com.google.protobuf.AbstractMessage) ByteString(com.google.protobuf.ByteString) DeleteInstanceRequest(com.google.spanner.admin.instance.v1.DeleteInstanceRequest) Test(org.junit.Test)

Aggregations

DeleteInstanceRequest (com.google.spanner.admin.instance.v1.DeleteInstanceRequest)5 DeleteInstanceRequest (com.google.bigtable.admin.v2.DeleteInstanceRequest)4 AbstractMessage (com.google.protobuf.AbstractMessage)4 Empty (com.google.protobuf.Empty)4 Test (org.junit.Test)4 ByteString (com.google.protobuf.ByteString)2 GrpcCallContext (com.google.api.gax.grpc.GrpcCallContext)1 InstanceName (com.google.bigtable.admin.v2.InstanceName)1 DeleteInstanceRequest (com.google.cloud.compute.v1.DeleteInstanceRequest)1 InstancesClient (com.google.cloud.compute.v1.InstancesClient)1 Operation (com.google.cloud.compute.v1.Operation)1 DeleteEnvironmentRequest (com.google.cloud.notebooks.v1beta1.DeleteEnvironmentRequest)1 DeleteInstanceRequest (com.google.cloud.notebooks.v1beta1.DeleteInstanceRequest)1 InstanceName (com.google.spanner.admin.instance.v1.InstanceName)1 AfterClass (org.junit.AfterClass)1