use of com.google.cloud.secretmanager.v1.ProjectName in project java-logging by googleapis.
the class ConfigClientTest method createSinkExceptionTest4.
@Test
public void createSinkExceptionTest4() throws Exception {
StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
mockConfigServiceV2.addException(exception);
try {
ProjectName parent = ProjectName.of("[PROJECT]");
LogSink sink = LogSink.newBuilder().build();
client.createSink(parent, sink);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
// Expected exception.
}
}
use of com.google.cloud.secretmanager.v1.ProjectName in project java-logging by googleapis.
the class ConfigClientTest method createExclusionExceptionTest4.
@Test
public void createExclusionExceptionTest4() throws Exception {
StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
mockConfigServiceV2.addException(exception);
try {
ProjectName parent = ProjectName.of("[PROJECT]");
LogExclusion exclusion = LogExclusion.newBuilder().build();
client.createExclusion(parent, exclusion);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
// Expected exception.
}
}
use of com.google.cloud.secretmanager.v1.ProjectName in project java-logging by googleapis.
the class LoggingClientTest method listLogsExceptionTest4.
@Test
public void listLogsExceptionTest4() throws Exception {
StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
mockLoggingServiceV2.addException(exception);
try {
ProjectName parent = ProjectName.of("[PROJECT]");
client.listLogs(parent);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
// Expected exception.
}
}
use of com.google.cloud.secretmanager.v1.ProjectName in project java-logging by googleapis.
the class ConfigClientTest method listSinksExceptionTest4.
@Test
public void listSinksExceptionTest4() throws Exception {
StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
mockConfigServiceV2.addException(exception);
try {
ProjectName parent = ProjectName.of("[PROJECT]");
client.listSinks(parent);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
// Expected exception.
}
}
use of com.google.cloud.secretmanager.v1.ProjectName in project java-logging by googleapis.
the class MetricsClientTest method listLogMetricsExceptionTest.
@Test
public void listLogMetricsExceptionTest() throws Exception {
StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT);
mockMetricsServiceV2.addException(exception);
try {
ProjectName parent = ProjectName.of("[PROJECT]");
client.listLogMetrics(parent);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
// Expected exception.
}
}
Aggregations