use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.Group in project oxTrust by GluuFederation.
the class GroupCoreLoadingStrategy method createDummyGroup.
private Group createDummyGroup() {
Group group = new Group();
group.setId("");
group.setExternalId("");
group.setDisplayName("");
Set<MemberRef> members = new HashSet<MemberRef>();
MemberRef memberRef = new MemberRef();
memberRef.setOperation("");
memberRef.setPrimary(false);
memberRef.setValue("test");
memberRef.setDisplay("");
memberRef.setType(MemberRef.Type.USER);
memberRef.setReference("");
members.add(memberRef);
group.setMembers(members);
return group;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.Group in project google-cloud-java by GoogleCloudPlatform.
the class GroupServiceClientTest method createGroupTest.
@Test
@SuppressWarnings("all")
public void createGroupTest() {
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);
ProjectName name = ProjectName.create("[PROJECT]");
Group group = Group.newBuilder().build();
Group actualResponse = client.createGroup(name, group);
Assert.assertEquals(expectedResponse, actualResponse);
List<GeneratedMessageV3> actualRequests = mockGroupService.getRequests();
Assert.assertEquals(1, actualRequests.size());
CreateGroupRequest actualRequest = (CreateGroupRequest) actualRequests.get(0);
Assert.assertEquals(name, actualRequest.getNameAsProjectName());
Assert.assertEquals(group, actualRequest.getGroup());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.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.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.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.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.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());
}
}
Aggregations