Package org.camunda.bpm.engine.identity

Examples of org.camunda.bpm.engine.identity.GroupQuery


      fail();
    } catch (ProcessEngineException e) {}
  }
 
  public void testQueryByNameLike() {
    GroupQuery query = identityService.createGroupQuery().groupNameLike("%Famous%");
    verifyQueryResults(query, 2);
   
    query = identityService.createGroupQuery().groupNameLike("Famous%");
    verifyQueryResults(query, 2);
   
View Full Code Here


    query = identityService.createGroupQuery().groupNameLike("%show%");
    verifyQueryResults(query, 1);
  }
 
  public void testQueryByInvalidNameLike() {
    GroupQuery query = identityService.createGroupQuery().groupNameLike("%invalid%");
    verifyQueryResults(query, 0);
   
    try {
      identityService.createGroupQuery().groupNameLike(null).list();
      fail();
View Full Code Here

      fail();
    } catch (ProcessEngineException e) {}
  }
 
  public void testQueryByType() {
    GroupQuery query = identityService.createGroupQuery().groupType("user");
    verifyQueryResults(query, 3);
   
    query = identityService.createGroupQuery().groupType("admin");
    verifyQueryResults(query, 0);
  }
View Full Code Here

    query = identityService.createGroupQuery().groupType("admin");
    verifyQueryResults(query, 0);
  }
 
  public void testQueryByInvalidType() {
    GroupQuery query = identityService.createGroupQuery().groupType("invalid");
    verifyQueryResults(query, 0);
   
    try {
      identityService.createGroupQuery().groupType(null).list();
      fail();
View Full Code Here

      fail();
    } catch (ProcessEngineException e) {}
  }
 
  public void testQueryByMember() {
    GroupQuery query = identityService.createGroupQuery().groupMember("fozzie");
    verifyQueryResults(query, 2);
   
    query = identityService.createGroupQuery().groupMember("kermit");
    verifyQueryResults(query, 3);
   
    query = query.orderByGroupId().asc();
    List<Group> groups = query.list();
    assertEquals(3, groups.size());
    assertEquals("admin", groups.get(0).getId());
    assertEquals("frogs", groups.get(1).getId());
    assertEquals("muppets", groups.get(2).getId());

    query = query.groupType("user");
    groups = query.list();
    assertEquals(2, groups.size());
    assertEquals("frogs", groups.get(0).getId());
    assertEquals("muppets", groups.get(1).getId());
  }
View Full Code Here

    assertEquals("frogs", groups.get(0).getId());
    assertEquals("muppets", groups.get(1).getId());
  }
 
  public void testQueryByInvalidMember() {
    GroupQuery query = identityService.createGroupQuery().groupMember("invalid");
    verifyQueryResults(query, 0);
   
    try {
      identityService.createGroupQuery().groupMember(null).list();
      fail();
View Full Code Here

    assertEquals(4, identityService.createGroupQuery().orderByGroupId().desc().count());
    assertEquals(4, identityService.createGroupQuery().orderByGroupName().desc().count());
    assertEquals(4, identityService.createGroupQuery().orderByGroupType().desc().count());
   
    // Multiple sortings
    GroupQuery query = identityService.createGroupQuery().orderByGroupType().asc().orderByGroupName().desc();
    List<Group> groups = query.list();
    assertEquals(4, query.count());
   
    assertEquals("security", groups.get(0).getType());
    assertEquals("user", groups.get(1).getType());
    assertEquals("user", groups.get(2).getType());
    assertEquals("user", groups.get(3).getType());
View Full Code Here

  }
 
  @Test
  public void testGetSingleGroup() {   
    Group sampleGroup = MockProvider.createMockGroup();
    GroupQuery sampleGroupQuery = mock(GroupQuery.class);
    when(identityServiceMock.createGroupQuery()).thenReturn(sampleGroupQuery);
    when(sampleGroupQuery.groupId(MockProvider.EXAMPLE_GROUP_ID)).thenReturn(sampleGroupQuery);
    when(sampleGroupQuery.singleResult()).thenReturn(sampleGroup);
   
    given().pathParam("id", MockProvider.EXAMPLE_GROUP_ID)
      .then().expect().statusCode(Status.OK.getStatusCode())
      .body("id", equalTo(MockProvider.EXAMPLE_GROUP_ID))
      .body("name", equalTo(MockProvider.EXAMPLE_GROUP_NAME))
View Full Code Here

  @Test
  public void testGroupResourceOptionsUnauthenticated() {
    String fullGroupUrl = "http://localhost:" + PORT + TEST_RESOURCE_ROOT_PATH + "/group/" + MockProvider.EXAMPLE_GROUP_ID;
   
    Group sampleGroup = MockProvider.createMockGroup();
    GroupQuery sampleGroupQuery = mock(GroupQuery.class);
    when(identityServiceMock.createGroupQuery()).thenReturn(sampleGroupQuery);
    when(sampleGroupQuery.groupId(MockProvider.EXAMPLE_GROUP_ID)).thenReturn(sampleGroupQuery);
    when(sampleGroupQuery.singleResult()).thenReturn(sampleGroup);
   
    given()
        .pathParam("id", MockProvider.EXAMPLE_GROUP_ID)
    .then()
        .expect().statusCode(Status.OK.getStatusCode())
View Full Code Here

    when(identityServiceMock.getCurrentAuthentication()).thenReturn(authentication);
    when(authorizationServiceMock.isUserAuthorized(MockProvider.EXAMPLE_USER_ID, null, DELETE, GROUP, MockProvider.EXAMPLE_GROUP_ID)).thenReturn(false);
    when(authorizationServiceMock.isUserAuthorized(MockProvider.EXAMPLE_USER_ID, null, UPDATE, GROUP, MockProvider.EXAMPLE_GROUP_ID)).thenReturn(false);
   
    Group sampleGroup = MockProvider.createMockGroup();
    GroupQuery sampleGroupQuery = mock(GroupQuery.class);
    when(identityServiceMock.createGroupQuery()).thenReturn(sampleGroupQuery);
    when(sampleGroupQuery.groupId(MockProvider.EXAMPLE_GROUP_ID)).thenReturn(sampleGroupQuery);
    when(sampleGroupQuery.singleResult()).thenReturn(sampleGroup);
   
    given()
        .pathParam("id", MockProvider.EXAMPLE_GROUP_ID)
    .then()
        .expect().statusCode(Status.OK.getStatusCode())
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.identity.GroupQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.