use of org.orcid.jaxb.model.record_rc2.Group in project google-cloud-java by GoogleCloudPlatform.
the class GroupServiceClientTest method updateGroupTest.
@Test
@SuppressWarnings("all")
public void updateGroupTest() {
GroupName name = 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(name).setDisplayName(displayName).setParentNameWithGroupName(parentName).setFilter(filter).setIsCluster(isCluster).build();
mockGroupService.addResponse(expectedResponse);
Group group = Group.newBuilder().build();
Group actualResponse = client.updateGroup(group);
Assert.assertEquals(expectedResponse, actualResponse);
List<GeneratedMessageV3> actualRequests = mockGroupService.getRequests();
Assert.assertEquals(1, actualRequests.size());
UpdateGroupRequest actualRequest = (UpdateGroupRequest) actualRequests.get(0);
Assert.assertEquals(group, actualRequest.getGroup());
}
use of org.orcid.jaxb.model.record_rc2.Group in project google-cloud-java by GoogleCloudPlatform.
the class GroupServiceClientTest method createGroupExceptionTest.
@Test
@SuppressWarnings("all")
public void createGroupExceptionTest() throws Exception {
StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
mockGroupService.addException(exception);
try {
ProjectName name = ProjectName.create("[PROJECT]");
Group group = Group.newBuilder().build();
client.createGroup(name, group);
Assert.fail("No exception raised");
} catch (ApiException e) {
Assert.assertEquals(Status.INVALID_ARGUMENT.getCode(), e.getStatusCode());
}
}
use of org.orcid.jaxb.model.record_rc2.Group in project google-cloud-java by GoogleCloudPlatform.
the class GroupServiceClientTest method updateGroupExceptionTest.
@Test
@SuppressWarnings("all")
public void updateGroupExceptionTest() throws Exception {
StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
mockGroupService.addException(exception);
try {
Group group = Group.newBuilder().build();
client.updateGroup(group);
Assert.fail("No exception raised");
} catch (ApiException e) {
Assert.assertEquals(Status.INVALID_ARGUMENT.getCode(), e.getStatusCode());
}
}
use of org.orcid.jaxb.model.record_rc2.Group 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());
}
use of org.orcid.jaxb.model.record_rc2.Group in project openstack4j by ContainX.
the class KeystoneGroupServiceTests method group_get_byName_byDomainId_NotExist_Test.
public void group_get_byName_byDomainId_NotExist_Test() throws Exception {
respondWith(JSON_GROUPS_EMPTY_LIST);
Group group = osv3().identity().groups().getByName(GROUP_NAME, GROUP_DOMAIN_ID);
assertNull(group);
}
Aggregations