use of com.google.privacy.dlp.v2.StoredInfoTypeName in project java-dlp by googleapis.
the class DlpServiceClientTest method deleteStoredInfoTypeExceptionTest.
@Test
public void deleteStoredInfoTypeExceptionTest() throws Exception {
StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
mockDlpService.addException(exception);
try {
StoredInfoTypeName name = StoredInfoTypeName.ofOrganizationStoredInfoTypeName("[ORGANIZATION]", "[STORED_INFO_TYPE]");
client.deleteStoredInfoType(name);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
// Expected exception.
}
}
use of com.google.privacy.dlp.v2.StoredInfoTypeName in project java-dlp by googleapis.
the class DlpServiceClientTest method deleteStoredInfoTypeTest.
@Test
public void deleteStoredInfoTypeTest() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
mockDlpService.addResponse(expectedResponse);
StoredInfoTypeName name = StoredInfoTypeName.ofOrganizationStoredInfoTypeName("[ORGANIZATION]", "[STORED_INFO_TYPE]");
client.deleteStoredInfoType(name);
List<AbstractMessage> actualRequests = mockDlpService.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteStoredInfoTypeRequest actualRequest = ((DeleteStoredInfoTypeRequest) actualRequests.get(0));
Assert.assertEquals(name.toString(), actualRequest.getName());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Aggregations