Search in sources :

Example 1 with UpdateAppProfileRequest

use of com.google.bigtable.admin.v2.UpdateAppProfileRequest in project java-bigtable by googleapis.

the class BaseBigtableInstanceAdminClientTest method updateAppProfileTest.

@Test
public void updateAppProfileTest() throws Exception {
    AppProfile expectedResponse = AppProfile.newBuilder().setName(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString()).setEtag("etag3123477").setDescription("description-1724546052").build();
    Operation resultOperation = Operation.newBuilder().setName("updateAppProfileTest").setDone(true).setResponse(Any.pack(expectedResponse)).build();
    mockBigtableInstanceAdmin.addResponse(resultOperation);
    AppProfile appProfile = AppProfile.newBuilder().build();
    FieldMask updateMask = FieldMask.newBuilder().build();
    AppProfile actualResponse = client.updateAppProfileAsync(appProfile, updateMask).get();
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockBigtableInstanceAdmin.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    UpdateAppProfileRequest actualRequest = ((UpdateAppProfileRequest) actualRequests.get(0));
    Assert.assertEquals(appProfile, actualRequest.getAppProfile());
    Assert.assertEquals(updateMask, actualRequest.getUpdateMask());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : AbstractMessage(com.google.protobuf.AbstractMessage) UpdateAppProfileRequest(com.google.bigtable.admin.v2.UpdateAppProfileRequest) AppProfile(com.google.bigtable.admin.v2.AppProfile) Operation(com.google.longrunning.Operation) FieldMask(com.google.protobuf.FieldMask) Test(org.junit.Test)

Aggregations

AppProfile (com.google.bigtable.admin.v2.AppProfile)1 UpdateAppProfileRequest (com.google.bigtable.admin.v2.UpdateAppProfileRequest)1 Operation (com.google.longrunning.Operation)1 AbstractMessage (com.google.protobuf.AbstractMessage)1 FieldMask (com.google.protobuf.FieldMask)1 Test (org.junit.Test)1