Search in sources :

Example 16 with DeleteSnapshotRequest

use of com.google.bigtable.admin.v2.DeleteSnapshotRequest in project gapic-generator-java by googleapis.

the class SubscriptionAdminClientTest method deleteSnapshotTest.

@Test
public void deleteSnapshotTest() throws Exception {
    Empty expectedResponse = Empty.newBuilder().build();
    mockSubscriber.addResponse(expectedResponse);
    SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
    client.deleteSnapshot(snapshot);
    List<AbstractMessage> actualRequests = mockSubscriber.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    DeleteSnapshotRequest actualRequest = ((DeleteSnapshotRequest) actualRequests.get(0));
    Assert.assertEquals(snapshot.toString(), actualRequest.getSnapshot());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : Empty(com.google.protobuf.Empty) AbstractMessage(com.google.protobuf.AbstractMessage) DeleteSnapshotRequest(com.google.pubsub.v1.DeleteSnapshotRequest) SnapshotName(com.google.pubsub.v1.SnapshotName) Test(org.junit.Test)

Example 17 with DeleteSnapshotRequest

use of com.google.bigtable.admin.v2.DeleteSnapshotRequest in project gapic-generator-java by googleapis.

the class SubscriptionAdminClientTest method deleteSnapshotTest2.

@Test
public void deleteSnapshotTest2() throws Exception {
    Empty expectedResponse = Empty.newBuilder().build();
    mockSubscriber.addResponse(expectedResponse);
    String snapshot = "snapshot284874180";
    client.deleteSnapshot(snapshot);
    List<AbstractMessage> actualRequests = mockSubscriber.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    DeleteSnapshotRequest actualRequest = ((DeleteSnapshotRequest) actualRequests.get(0));
    Assert.assertEquals(snapshot, actualRequest.getSnapshot());
    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) DeleteSnapshotRequest(com.google.pubsub.v1.DeleteSnapshotRequest) Test(org.junit.Test)

Aggregations

DeleteSnapshotRequest (com.google.pubsub.v1.DeleteSnapshotRequest)13 Empty (com.google.protobuf.Empty)8 Test (org.junit.Test)7 AbstractMessage (com.google.protobuf.AbstractMessage)6 DeleteSnapshotRequest (com.google.bigtable.admin.v2.DeleteSnapshotRequest)4 ByteString (com.google.protobuf.ByteString)3 SnapshotName (com.google.pubsub.v1.SnapshotName)3 SubscriptionAdminClient (com.google.cloud.pubsub.v1.SubscriptionAdminClient)2 SnapshotName (com.google.bigtable.admin.v2.SnapshotName)1 GeneratedMessageV3 (com.google.protobuf.GeneratedMessageV3)1