Search in sources :

Example 1 with GetGroupRequest

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

the class GroupServiceClientTest method getGroupTest.

@Test
@SuppressWarnings("all")
public void getGroupTest() {
    GroupName name2 = GroupName.create("[PROJECT]", "[GROUP]");
    String displayName = "displayName1615086568";
    GroupName parentName = GroupName.create("[PROJECT]", "[GROUP]");
    String filter = "filter-1274492040";
    boolean isCluster = false;
    Group expectedResponse = Group.newBuilder().setNameWithGroupName(name2).setDisplayName(displayName).setParentNameWithGroupName(parentName).setFilter(filter).setIsCluster(isCluster).build();
    mockGroupService.addResponse(expectedResponse);
    GroupName name = GroupName.create("[PROJECT]", "[GROUP]");
    Group actualResponse = client.getGroup(name);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<GeneratedMessageV3> actualRequests = mockGroupService.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    GetGroupRequest actualRequest = (GetGroupRequest) actualRequests.get(0);
    Assert.assertEquals(name, actualRequest.getNameAsGroupName());
}
Also used : GroupName(com.google.monitoring.v3.GroupName) Group(com.google.monitoring.v3.Group) GetGroupRequest(com.google.monitoring.v3.GetGroupRequest) GeneratedMessageV3(com.google.protobuf.GeneratedMessageV3) Test(org.junit.Test)

Example 2 with GetGroupRequest

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

the class ErrorGroupServiceClientTest method getGroupTest.

@Test
@SuppressWarnings("all")
public void getGroupTest() {
    GroupName name = GroupName.create("[PROJECT]", "[GROUP]");
    String groupId = "groupId506361563";
    ErrorGroup expectedResponse = ErrorGroup.newBuilder().setNameWithGroupName(name).setGroupId(groupId).build();
    mockErrorGroupService.addResponse(expectedResponse);
    GroupName groupName = GroupName.create("[PROJECT]", "[GROUP]");
    ErrorGroup actualResponse = client.getGroup(groupName);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<GeneratedMessageV3> actualRequests = mockErrorGroupService.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    GetGroupRequest actualRequest = (GetGroupRequest) actualRequests.get(0);
    Assert.assertEquals(groupName, actualRequest.getGroupNameAsGroupName());
}
Also used : GroupName(com.google.devtools.clouderrorreporting.v1beta1.GroupName) ErrorGroup(com.google.devtools.clouderrorreporting.v1beta1.ErrorGroup) GetGroupRequest(com.google.devtools.clouderrorreporting.v1beta1.GetGroupRequest) GeneratedMessageV3(com.google.protobuf.GeneratedMessageV3) Test(org.junit.Test)

Aggregations

GeneratedMessageV3 (com.google.protobuf.GeneratedMessageV3)2 Test (org.junit.Test)2 ErrorGroup (com.google.devtools.clouderrorreporting.v1beta1.ErrorGroup)1 GetGroupRequest (com.google.devtools.clouderrorreporting.v1beta1.GetGroupRequest)1 GroupName (com.google.devtools.clouderrorreporting.v1beta1.GroupName)1 GetGroupRequest (com.google.monitoring.v3.GetGroupRequest)1 Group (com.google.monitoring.v3.Group)1 GroupName (com.google.monitoring.v3.GroupName)1