use of com.google.cloud.automl.v1beta1.LocationName in project java-dlp by googleapis.
the class DlpServiceClientTest method createDeidentifyTemplateExceptionTest.
@Test
public void createDeidentifyTemplateExceptionTest() throws Exception {
StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
mockDlpService.addException(exception);
try {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
DeidentifyTemplate deidentifyTemplate = DeidentifyTemplate.newBuilder().build();
client.createDeidentifyTemplate(parent, deidentifyTemplate);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
// Expected exception.
}
}
use of com.google.cloud.automl.v1beta1.LocationName in project java-dlp by googleapis.
the class DlpServiceClientTest method createJobTriggerExceptionTest.
@Test
public void createJobTriggerExceptionTest() throws Exception {
StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
mockDlpService.addException(exception);
try {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
JobTrigger jobTrigger = JobTrigger.newBuilder().build();
client.createJobTrigger(parent, jobTrigger);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
// Expected exception.
}
}
use of com.google.cloud.automl.v1beta1.LocationName in project java-dlp by googleapis.
the class DlpServiceClientTest method createDlpJobExceptionTest2.
@Test
public void createDlpJobExceptionTest2() throws Exception {
StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
mockDlpService.addException(exception);
try {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
RiskAnalysisJobConfig riskJob = RiskAnalysisJobConfig.newBuilder().build();
client.createDlpJob(parent, riskJob);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
// Expected exception.
}
}
use of com.google.cloud.automl.v1beta1.LocationName in project java-dlp by googleapis.
the class DlpServiceClientTest method createDlpJobExceptionTest.
@Test
public void createDlpJobExceptionTest() throws Exception {
StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
mockDlpService.addException(exception);
try {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
InspectJobConfig inspectJob = InspectJobConfig.newBuilder().build();
client.createDlpJob(parent, inspectJob);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
// Expected exception.
}
}
use of com.google.cloud.automl.v1beta1.LocationName in project java-dlp by googleapis.
the class DlpServiceClientTest method listJobTriggersExceptionTest.
@Test
public void listJobTriggersExceptionTest() throws Exception {
StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
mockDlpService.addException(exception);
try {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
client.listJobTriggers(parent);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
// Expected exception.
}
}
Aggregations