Package org.camunda.bpm.engine.identity

Examples of org.camunda.bpm.engine.identity.GroupQuery.list()


    // group query
    List<Group> mockGroups = MockProvider.createMockGroups();
    when(sampleGroupQuery.groupMember(anyString())).thenReturn(sampleGroupQuery);
    when(sampleGroupQuery.orderByGroupName()).thenReturn(sampleGroupQuery);
    when(sampleGroupQuery.asc()).thenReturn(sampleGroupQuery);
    when(sampleGroupQuery.list()).thenReturn(mockGroups);

    when(mockIdentityService.createGroupQuery()).thenReturn(sampleGroupQuery);
    when(mockIdentityService.createUserQuery()).thenReturn(sampleUserQuery);
  }
View Full Code Here


    GroupQuery mockGroupQuery = mock(GroupQuery.class);

    when(identityServiceMock.createGroupQuery()).thenReturn(mockGroupQuery);
    when(mockGroupQuery.groupMember(anyString())).thenReturn(mockGroupQuery);
    when(mockGroupQuery.list()).thenReturn(groupMocks);

    setupFilter();
  }

  protected void setupFilter() throws ServletException {
View Full Code Here

    GroupQuery mockGroupQuery = mock(GroupQuery.class);

    when(identityServiceMock.createGroupQuery()).thenReturn(mockGroupQuery);
    when(mockGroupQuery.groupMember(anyString())).thenReturn(mockGroupQuery);
    when(mockGroupQuery.list()).thenReturn(groupMocks);

    // example method
    ProcessDefinition mockDefinition = MockProvider.createMockDefinition();
    List<ProcessDefinition> mockDefinitions = Arrays.asList(mockDefinition);
    ProcessDefinitionQuery mockQuery = mock(ProcessDefinitionQuery.class);
View Full Code Here

    List<Group> resultList;
    if(firstResult != null || maxResults != null) {
      resultList = executePaginatedQuery(query, firstResult, maxResults);
    } else {
      resultList = query.list();
    }

    return GroupDto.fromGroupList(resultList);
  }
View Full Code Here

   
    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());
View Full Code Here

    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(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());
View Full Code Here

    when(sampleUserQuery.count()).thenReturn((long) mockUsers.size());
 
    GroupQuery sampleGroupQuery = mock(GroupQuery.class);
   
    List<Group> mockGroups = MockProvider.createMockGroups();
    when(sampleGroupQuery.list()).thenReturn(mockGroups);
    when(sampleGroupQuery.groupMember(anyString())).thenReturn(sampleGroupQuery);
    when(sampleGroupQuery.orderByGroupName()).thenReturn(sampleGroupQuery);
    when(sampleGroupQuery.orderByGroupId()).thenReturn(sampleGroupQuery);
    when(sampleGroupQuery.orderByGroupType()).thenReturn(sampleGroupQuery);
    when(sampleGroupQuery.asc()).thenReturn(sampleGroupQuery);
View Full Code Here

    mockQuery = setUpMockGroupQuery(MockProvider.createMockGroups());
  }

  private GroupQuery setUpMockGroupQuery(List<Group> list) {
    GroupQuery sampleGroupQuery = mock(GroupQuery.class);
    when(sampleGroupQuery.list()).thenReturn(list);
    when(sampleGroupQuery.count()).thenReturn((long) list.size());
 
    when(processEngine.getIdentityService().createGroupQuery()).thenReturn(sampleGroupQuery);
 
    return sampleGroupQuery;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.