test_class.file: modules/flowable-rest/src/test/java/org/flowable/rest/service/api/identity/GroupCollectionResourceTest.java
test_class.identifier: GroupCollectionResourceTest
test_class.superclass: extends BaseSpringRestTestCase
test_case.body: @Test
      @Deployment
      public void testGetGroups() throws Exception {
          List<Group> savedGroups = new ArrayList<>();
          try {
              Group group1 = identityService.newGroup("testgroup1");
              group1.setName("Test group");
              group1.setType("Test type");
              identityService.saveGroup(group1);
              savedGroups.add(group1);
  
              Group group2 = identityService.newGroup("testgroup2");
              group2.setName("Another group");
              group2.setType("Another type");
              identityService.saveGroup(group2);
              savedGroups.add(group2);
  
              Group group3 = identityService.createGroupQuery().groupId("admin").singleResult();
              assertThat(group3).isNotNull();
              
              Group group4 = identityService.createGroupQuery().groupId("sales").singleResult();
              assertThat(group4).isNotNull();
  
              // Test filter-less
              String url = RestUrls.createRelativeResourceUrl(RestUrls.URL_GROUP_COLLECTION);
              assertResultsPresentInDataResponse(url, group1.getId(), group2.getId(), group3.getId(), group4.getId());
  
              // Test based on name
              url = RestUrls.createRelativeResourceUrl(RestUrls.URL_GROUP_COLLECTION) + "?name=" + encode("Test group");
              assertResultsPresentInDataResponse(url, group1.getId());
  
              // Test based on name like
              url = RestUrls.createRelativeResourceUrl(RestUrls.URL_GROUP_COLLECTION) + "?nameLike=" + encode("% group");
              assertResultsPresentInDataResponse(url, group2.getId(), group1.getId());
  
              // Test based on type
              url = RestUrls.createRelativeResourceUrl(RestUrls.URL_GROUP_COLLECTION) + "?type=" + encode("Another type");
              assertResultsPresentInDataResponse(url, group2.getId());
  
              // Test based on group member
              url = RestUrls.createRelativeResourceUrl(RestUrls.URL_GROUP_COLLECTION) + "?member=kermit";
              assertResultsPresentInDataResponse(url, group3.getId());
  
          } finally {
  
              // Delete groups after test passes or fails
              if (!savedGroups.isEmpty()) {
                  for (Group group : savedGroups) {
                      identityService.deleteGroup(group.getId());
                  }
              }
          }
      }
test_case.class_method_signature: GroupCollectionResourceTest.testGetGroups()
test_case.full_signature: @Test @Deployment public void testGetGroups()
test_case.identifier: testGetGroups
test_case.invocations: newGroup setName setType saveGroup add newGroup setName setType saveGroup add singleResult groupId createGroupQuery isNotNull assertThat singleResult groupId createGroupQuery isNotNull assertThat createRelativeResourceUrl assertResultsPresentInDataResponse getId getId getId getId createRelativeResourceUrl encode assertResultsPresentInDataResponse getId createRelativeResourceUrl encode assertResultsPresentInDataResponse getId getId createRelativeResourceUrl encode assertResultsPresentInDataResponse getId createRelativeResourceUrl assertResultsPresentInDataResponse getId isEmpty deleteGroup getId
test_case.modifiers: @Test @Deployment public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetGroups()
focal_class.declarator: properties = new HashMap<>()
focal_class.modifier: protected static
focal_class.original_string: protected static HashMap<String, QueryProperty> properties = new HashMap<>();
focal_class.type: HashMap<String, QueryProperty>
focal_class.var_name: properties
focal_class.declarator: restResponseFactory
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected RestResponseFactory restResponseFactory;
focal_class.type: RestResponseFactory
focal_class.var_name: restResponseFactory
focal_class.declarator: identityService
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected IdentityService identityService;
focal_class.type: IdentityService
focal_class.var_name: identityService
focal_class.declarator: restApiInterceptor
focal_class.modifier: @Autowired(required=false)
      protected
focal_class.original_string: @Autowired(required=false)
      protected BpmnRestApiInterceptor restApiInterceptor;
focal_class.type: BpmnRestApiInterceptor
focal_class.var_name: restApiInterceptor
focal_class.file: modules/flowable-rest/src/main/java/org/flowable/rest/service/api/identity/GroupCollectionResource.java
focal_class.identifier: GroupCollectionResource
focal_class.class_method_signature: GroupCollectionResource.getGroups(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_class.full_signature: @ApiOperation(value = "List groups", nickname="listGroups", tags = { "Groups" }, produces = "application/json") @ApiImplicitParams({ @ApiImplicitParam(name = "id", dataType = "string", value = "Only return group with the given id", paramType = "query"), @ApiImplicitParam(name = "name", dataType = "string", value = "Only return groups with the given name", paramType = "query"), @ApiImplicitParam(name = "type", dataType = "string", value = "Only return groups with the given type", paramType = "query"), @ApiImplicitParam(name = "nameLike", dataType = "string", value = "Only return groups with a name like the given value. Use % as wildcard-character.", paramType = "query"), @ApiImplicitParam(name = "member", dataType = "string", value = "Only return groups which have a member with the given username.", paramType = "query"), @ApiImplicitParam(name = "potentialStarter", dataType = "string", value = "Only return groups which members are potential starters for a process-definition with the given id.", paramType = "query"), @ApiImplicitParam(name = "sort", dataType = "string", value = "Property to sort on, to be used together with the order.", allowableValues = "id,name,type", paramType = "query"), }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the requested groups were returned.") }) @GetMapping(value = "/identity/groups", produces = "application/json") public DataResponse<GroupResponse> getGroups(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_class.identifier: getGroups
focal_class.modifiers: @ApiOperation(value = "List groups", nickname="listGroups", tags = { "Groups" }, produces = "application/json") @ApiImplicitParams({ @ApiImplicitParam(name = "id", dataType = "string", value = "Only return group with the given id", paramType = "query"), @ApiImplicitParam(name = "name", dataType = "string", value = "Only return groups with the given name", paramType = "query"), @ApiImplicitParam(name = "type", dataType = "string", value = "Only return groups with the given type", paramType = "query"), @ApiImplicitParam(name = "nameLike", dataType = "string", value = "Only return groups with a name like the given value. Use % as wildcard-character.", paramType = "query"), @ApiImplicitParam(name = "member", dataType = "string", value = "Only return groups which have a member with the given username.", paramType = "query"), @ApiImplicitParam(name = "potentialStarter", dataType = "string", value = "Only return groups which members are potential starters for a process-definition with the given id.", paramType = "query"), @ApiImplicitParam(name = "sort", dataType = "string", value = "Property to sort on, to be used together with the order.", allowableValues = "id,name,type", paramType = "query"), }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the requested groups were returned.") }) @GetMapping(value = "/identity/groups", produces = "application/json") public
focal_class.parameters: (@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_class.return: DataResponse<GroupResponse>
focal_class.signature: DataResponse<GroupResponse> getGroups(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_class.class_method_signature: GroupCollectionResource.createGroup(@RequestBody GroupRequest groupRequest, HttpServletRequest httpRequest, HttpServletResponse response)
focal_class.full_signature: @ApiOperation(value = "Create a group", tags = { "Groups" }) @ApiResponses(value = { @ApiResponse(code = 201, message = "Indicates the group was created."), @ApiResponse(code = 400, message = "Indicates the id of the group was missing.") }) @PostMapping(value = "/identity/groups", produces = "application/json") public GroupResponse createGroup(@RequestBody GroupRequest groupRequest, HttpServletRequest httpRequest, HttpServletResponse response)
focal_class.identifier: createGroup
focal_class.modifiers: @ApiOperation(value = "Create a group", tags = { "Groups" }) @ApiResponses(value = { @ApiResponse(code = 201, message = "Indicates the group was created."), @ApiResponse(code = 400, message = "Indicates the id of the group was missing.") }) @PostMapping(value = "/identity/groups", produces = "application/json") public
focal_class.parameters: (@RequestBody GroupRequest groupRequest, HttpServletRequest httpRequest, HttpServletResponse response)
focal_class.return: GroupResponse
focal_class.signature: GroupResponse createGroup(@RequestBody GroupRequest groupRequest, HttpServletRequest httpRequest, HttpServletResponse response)
focal_method.body: @ApiOperation(value = "List groups", nickname="listGroups", tags = { "Groups" }, produces = "application/json")
      @ApiImplicitParams({
              @ApiImplicitParam(name = "id", dataType = "string", value = "Only return group with the given id", paramType = "query"),
              @ApiImplicitParam(name = "name", dataType = "string", value = "Only return groups with the given name", paramType = "query"),
              @ApiImplicitParam(name = "type", dataType = "string", value = "Only return groups with the given type", paramType = "query"),
              @ApiImplicitParam(name = "nameLike", dataType = "string", value = "Only return groups with a name like the given value. Use % as wildcard-character.", paramType = "query"),
              @ApiImplicitParam(name = "member", dataType = "string", value = "Only return groups which have a member with the given username.", paramType = "query"),
              @ApiImplicitParam(name = "potentialStarter", dataType = "string", value = "Only return groups which members are potential starters for a process-definition with the given id.", paramType = "query"),
              @ApiImplicitParam(name = "sort", dataType = "string", value = "Property to sort on, to be used together with the order.", allowableValues = "id,name,type", paramType = "query"),
      })
      @ApiResponses(value = {
              @ApiResponse(code = 200, message = "Indicates the requested groups were returned.")
      })
      @GetMapping(value = "/identity/groups", produces = "application/json")
      public DataResponse<GroupResponse> getGroups(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request) {
          GroupQuery query = identityService.createGroupQuery();
  
          if (allRequestParams.containsKey("id")) {
              query.groupId(allRequestParams.get("id"));
          }
          if (allRequestParams.containsKey("name")) {
              query.groupName(allRequestParams.get("name"));
          }
          if (allRequestParams.containsKey("nameLike")) {
              query.groupNameLike(allRequestParams.get("nameLike"));
          }
          if (allRequestParams.containsKey("type")) {
              query.groupType(allRequestParams.get("type"));
          }
          if (allRequestParams.containsKey("member")) {
              query.groupMember(allRequestParams.get("member"));
          }
          
          if (restApiInterceptor != null) {
              restApiInterceptor.accessGroupInfoWithQuery(query);
          }
  
          return paginateList(allRequestParams, query, "id", properties, restResponseFactory::createGroupResponseList);
      }
focal_method.class_method_signature: GroupCollectionResource.getGroups(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_method.full_signature: @ApiOperation(value = "List groups", nickname="listGroups", tags = { "Groups" }, produces = "application/json") @ApiImplicitParams({ @ApiImplicitParam(name = "id", dataType = "string", value = "Only return group with the given id", paramType = "query"), @ApiImplicitParam(name = "name", dataType = "string", value = "Only return groups with the given name", paramType = "query"), @ApiImplicitParam(name = "type", dataType = "string", value = "Only return groups with the given type", paramType = "query"), @ApiImplicitParam(name = "nameLike", dataType = "string", value = "Only return groups with a name like the given value. Use % as wildcard-character.", paramType = "query"), @ApiImplicitParam(name = "member", dataType = "string", value = "Only return groups which have a member with the given username.", paramType = "query"), @ApiImplicitParam(name = "potentialStarter", dataType = "string", value = "Only return groups which members are potential starters for a process-definition with the given id.", paramType = "query"), @ApiImplicitParam(name = "sort", dataType = "string", value = "Property to sort on, to be used together with the order.", allowableValues = "id,name,type", paramType = "query"), }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the requested groups were returned.") }) @GetMapping(value = "/identity/groups", produces = "application/json") public DataResponse<GroupResponse> getGroups(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_method.identifier: getGroups
focal_method.invocations: createGroupQuery containsKey groupId get containsKey groupName get containsKey groupNameLike get containsKey groupType get containsKey groupMember get accessGroupInfoWithQuery paginateList
focal_method.modifiers: @ApiOperation(value = "List groups", nickname="listGroups", tags = { "Groups" }, produces = "application/json") @ApiImplicitParams({ @ApiImplicitParam(name = "id", dataType = "string", value = "Only return group with the given id", paramType = "query"), @ApiImplicitParam(name = "name", dataType = "string", value = "Only return groups with the given name", paramType = "query"), @ApiImplicitParam(name = "type", dataType = "string", value = "Only return groups with the given type", paramType = "query"), @ApiImplicitParam(name = "nameLike", dataType = "string", value = "Only return groups with a name like the given value. Use % as wildcard-character.", paramType = "query"), @ApiImplicitParam(name = "member", dataType = "string", value = "Only return groups which have a member with the given username.", paramType = "query"), @ApiImplicitParam(name = "potentialStarter", dataType = "string", value = "Only return groups which members are potential starters for a process-definition with the given id.", paramType = "query"), @ApiImplicitParam(name = "sort", dataType = "string", value = "Property to sort on, to be used together with the order.", allowableValues = "id,name,type", paramType = "query"), }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the requested groups were returned.") }) @GetMapping(value = "/identity/groups", produces = "application/json") public
focal_method.parameters: (@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_method.return: DataResponse<GroupResponse>
focal_method.signature: DataResponse<GroupResponse> getGroups(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)