Search in sources :

Example 11 with GroupName

use of com.google.devtools.clouderrorreporting.v1beta1.GroupName in project google-cloud-java by GoogleCloudPlatform.

the class ErrorGroupServiceClientTest method getGroupExceptionTest.

@Test
@SuppressWarnings("all")
public void getGroupExceptionTest() throws Exception {
    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
    mockErrorGroupService.addException(exception);
    try {
        GroupName groupName = GroupName.create("[PROJECT]", "[GROUP]");
        client.getGroup(groupName);
        Assert.fail("No exception raised");
    } catch (ApiException e) {
        Assert.assertEquals(Status.INVALID_ARGUMENT.getCode(), e.getStatusCode());
    }
}
Also used : GroupName(com.google.devtools.clouderrorreporting.v1beta1.GroupName) StatusRuntimeException(io.grpc.StatusRuntimeException) ApiException(com.google.api.gax.grpc.ApiException) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)11 GroupName (com.google.monitoring.v3.GroupName)8 GeneratedMessageV3 (com.google.protobuf.GeneratedMessageV3)7 ApiException (com.google.api.gax.grpc.ApiException)4 StatusRuntimeException (io.grpc.StatusRuntimeException)4 GroupName (com.google.devtools.clouderrorreporting.v1beta1.GroupName)3 Group (com.google.monitoring.v3.Group)3 ErrorGroup (com.google.devtools.clouderrorreporting.v1beta1.ErrorGroup)2 MonitoredResource (com.google.api.MonitoredResource)1 ListGroupMembersPagedResponse (com.google.cloud.monitoring.spi.v3.PagedResponseWrappers.ListGroupMembersPagedResponse)1 GetGroupRequest (com.google.devtools.clouderrorreporting.v1beta1.GetGroupRequest)1 UpdateGroupRequest (com.google.devtools.clouderrorreporting.v1beta1.UpdateGroupRequest)1 CreateGroupRequest (com.google.monitoring.v3.CreateGroupRequest)1 DeleteGroupRequest (com.google.monitoring.v3.DeleteGroupRequest)1 GetGroupRequest (com.google.monitoring.v3.GetGroupRequest)1 ListGroupMembersRequest (com.google.monitoring.v3.ListGroupMembersRequest)1 ListGroupMembersResponse (com.google.monitoring.v3.ListGroupMembersResponse)1 ProjectName (com.google.monitoring.v3.ProjectName)1 UpdateGroupRequest (com.google.monitoring.v3.UpdateGroupRequest)1 Empty (com.google.protobuf.Empty)1