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()));
}
Aggregations