Search in sources :

Example 11 with DeleteBackupRequest

use of com.google.spanner.admin.database.v1.DeleteBackupRequest in project java-spanner by googleapis.

the class DatabaseAdminClientTest method deleteBackupTest.

@Test
public void deleteBackupTest() throws Exception {
    Empty expectedResponse = Empty.newBuilder().build();
    mockDatabaseAdmin.addResponse(expectedResponse);
    BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]");
    client.deleteBackup(name);
    List<AbstractMessage> actualRequests = mockDatabaseAdmin.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0));
    Assert.assertEquals(name.toString(), actualRequest.getName());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : Empty(com.google.protobuf.Empty) AbstractMessage(com.google.protobuf.AbstractMessage) DeleteBackupRequest(com.google.spanner.admin.database.v1.DeleteBackupRequest) BackupName(com.google.spanner.admin.database.v1.BackupName) Test(org.junit.Test)

Aggregations

DeleteBackupRequest (com.google.bigtable.admin.v2.DeleteBackupRequest)6 Test (org.junit.Test)6 DeleteBackupRequest (com.google.spanner.admin.database.v1.DeleteBackupRequest)5 AbstractMessage (com.google.protobuf.AbstractMessage)4 Empty (com.google.protobuf.Empty)4 ByteString (com.google.protobuf.ByteString)2 GrpcCallContext (com.google.api.gax.grpc.GrpcCallContext)1 BackupName (com.google.bigtable.admin.v2.BackupName)1 BackupName (com.google.spanner.admin.database.v1.BackupName)1