Search in sources :

Example 16 with Group

use of org.gluu.oxtrust.model.scim2.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());
}
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 17 with Group

use of org.gluu.oxtrust.model.scim2.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);
}
Also used : Group(org.openstack4j.model.identity.v3.Group)

Example 18 with Group

use of org.gluu.oxtrust.model.scim2.Group in project openstack4j by ContainX.

the class KeystoneGroupServiceTests method group_crud_test.

// ------------ Group Tests ------------
// The following tests are to verify the update() method of the GroupService
// using HTTP PATCH, which is not supported by betamax.
// Find more tests in KeystoneGroupServiceSpec in core-integration-test
// module.
public void group_crud_test() throws Exception {
    Group group = Builders.group().name(GROUP_NAME).description(GROUP_DESCRIPTION).domainId(GROUP_DOMAIN_ID).build();
    respondWith(JSON_GROUPS_CREATE);
    Group newGroup = osv3().identity().groups().create(group);
    assertEquals(newGroup.getName(), GROUP_NAME);
    assertEquals(newGroup.getDomainId(), GROUP_DOMAIN_ID);
    assertEquals(newGroup.getDescription(), GROUP_DESCRIPTION);
    String GROUP_ID = newGroup.getId();
    respondWith(JSON_GROUPS_GET_BYID);
    Group group_setToUpdate = osv3().identity().groups().get(GROUP_ID);
    respondWith(JSON_GROUPS_UPDATE);
    Group updatedGroup = osv3.identity().groups().update(group_setToUpdate.toBuilder().description(GROUP_DESCRIPTION_UPDATE).build());
    assertEquals(updatedGroup.getId(), GROUP_ID);
    assertEquals(updatedGroup.getName(), GROUP_NAME);
    assertEquals(updatedGroup.getDomainId(), GROUP_DOMAIN_ID);
    assertEquals(updatedGroup.getDescription(), GROUP_DESCRIPTION_UPDATE);
}
Also used : Group(org.openstack4j.model.identity.v3.Group)

Example 19 with Group

use of org.gluu.oxtrust.model.scim2.Group in project camel by apache.

the class GroupProducer method doGet.

private void doGet(Exchange exchange) {
    final Message msg = exchange.getIn();
    final String id = msg.getHeader(OpenstackConstants.ID, msg.getHeader(KeystoneConstants.GROUP_ID, String.class), String.class);
    ObjectHelper.notEmpty(id, "Group ID");
    final Group result = osV3Client.identity().groups().get(id);
    msg.setBody(result);
}
Also used : Group(org.openstack4j.model.identity.v3.Group) Message(org.apache.camel.Message)

Example 20 with Group

use of org.gluu.oxtrust.model.scim2.Group in project camel by apache.

the class GroupProducer method doCreate.

private void doCreate(Exchange exchange) {
    final Group in = messageToGroup(exchange.getIn());
    final Group out = osV3Client.identity().groups().create(in);
    exchange.getIn().setBody(out);
}
Also used : Group(org.openstack4j.model.identity.v3.Group)

Aggregations

ArrayList (java.util.ArrayList)12 DuplicateEntryException (org.gluu.site.ldap.exception.DuplicateEntryException)12 EntryPersistenceException (org.gluu.site.ldap.persistence.exception.EntryPersistenceException)10 DefaultValue (javax.ws.rs.DefaultValue)9 HeaderParam (javax.ws.rs.HeaderParam)9 Produces (javax.ws.rs.Produces)9 GluuGroup (org.gluu.oxtrust.model.GluuGroup)9 Group (org.gluu.oxtrust.model.scim2.Group)9 URI (java.net.URI)8 Group (org.openstack4j.model.identity.v3.Group)8 ApiOperation (com.wordnik.swagger.annotations.ApiOperation)7 Response (javax.ws.rs.core.Response)7 ListResponse (org.gluu.oxtrust.model.scim2.ListResponse)7 Group (com.google.monitoring.v3.Group)5 Path (javax.ws.rs.Path)5 Test (org.junit.Test)5 VirtualListViewResponse (org.xdi.ldap.model.VirtualListViewResponse)5 IOException (java.io.IOException)4 Map (java.util.Map)4 GET (javax.ws.rs.GET)4