test_class.file: modules/flowable-rest/src/test/java/org/flowable/rest/service/api/identity/UserCollectionResourceTest.java
test_class.identifier: UserCollectionResourceTest
test_class.superclass: extends BaseSpringRestTestCase
test_case.body: @Test
      @Deployment
      public void testGetUsers() throws Exception {
          List<User> savedUsers = new ArrayList<>();
          try {
              User user1 = identityService.newUser("testuser");
              user1.setFirstName("Fred");
              user1.setLastName("McDonald");
              user1.setDisplayName("Fred McDonald");
              user1.setEmail("no-reply@flowable.org");
              identityService.saveUser(user1);
              savedUsers.add(user1);
  
              User user2 = identityService.newUser("anotherUser");
              user2.setFirstName("Tijs");
              user2.setLastName("Barrez");
              user2.setEmail("no-reply@flowable.com");
              identityService.saveUser(user2);
              savedUsers.add(user2);
  
              User user3 = identityService.createUserQuery().userId("kermit").singleResult();
              assertThat(user3).isNotNull();
  
              User user4 = identityService.createUserQuery().userId("aSalesUser").singleResult();
              assertThat(user4).isNotNull();
  
              // Test filter-less
              String url = RestUrls.createRelativeResourceUrl(RestUrls.URL_USER_COLLECTION);
              assertResultsPresentInDataResponse(url, user1.getId(), user2.getId(), user3.getId(), user4.getId());
  
              // Test based on userId
              url = RestUrls.createRelativeResourceUrl(RestUrls.URL_USER_COLLECTION) + "?id=testuser";
              assertResultsPresentInDataResponse(url, user1.getId());
  
              // Test based on firstName
              url = RestUrls.createRelativeResourceUrl(RestUrls.URL_USER_COLLECTION) + "?firstName=Tijs";
              assertResultsPresentInDataResponse(url, user2.getId());
  
              // Test based on lastName
              url = RestUrls.createRelativeResourceUrl(RestUrls.URL_USER_COLLECTION) + "?lastName=Barrez";
              assertResultsPresentInDataResponse(url, user2.getId());
  
              // Test based on displayName
              url = RestUrls.createRelativeResourceUrl(RestUrls.URL_USER_COLLECTION) + "?displayName=Fred%20McDonald";
              assertResultsPresentInDataResponse(url, user1.getId());
  
              // Test based on email
              url = RestUrls.createRelativeResourceUrl(RestUrls.URL_USER_COLLECTION) + "?email=no-reply@flowable.org";
              assertResultsPresentInDataResponse(url, user1.getId());
  
              // Test based on firstNameLike
              url = RestUrls.createRelativeResourceUrl(RestUrls.URL_USER_COLLECTION) + "?firstNameLike=" + encode("%ij%");
              assertResultsPresentInDataResponse(url, user2.getId());
  
              // Test based on lastNameLike
              url = RestUrls.createRelativeResourceUrl(RestUrls.URL_USER_COLLECTION) + "?lastNameLike=" + encode("%rez");
              assertResultsPresentInDataResponse(url, user2.getId());
  
              // Test based on displayNameLike
              url = RestUrls.createRelativeResourceUrl(RestUrls.URL_USER_COLLECTION) + "?displayNameLike=" + encode("%red Mc%");
              assertResultsPresentInDataResponse(url, user1.getId());
  
              // Test based on emailLike
              url = RestUrls.createRelativeResourceUrl(RestUrls.URL_USER_COLLECTION) + "?emailLike=" + encode("no-reply@flowable.org%");
              assertResultsPresentInDataResponse(url, user1.getId());
  
              // Test based on memberOfGroup
              url = RestUrls.createRelativeResourceUrl(RestUrls.URL_USER_COLLECTION) + "?memberOfGroup=admin";
              assertResultsPresentInDataResponse(url, user3.getId());
  
          } finally {
  
              // Delete user after test passes or fails
              if (!savedUsers.isEmpty()) {
                  for (User user : savedUsers) {
                      identityService.deleteUser(user.getId());
                  }
              }
          }
      }
test_case.class_method_signature: UserCollectionResourceTest.testGetUsers()
test_case.full_signature: @Test @Deployment public void testGetUsers()
test_case.identifier: testGetUsers
test_case.invocations: newUser setFirstName setLastName setDisplayName setEmail saveUser add newUser setFirstName setLastName setEmail saveUser add singleResult userId createUserQuery isNotNull assertThat singleResult userId createUserQuery isNotNull assertThat createRelativeResourceUrl assertResultsPresentInDataResponse getId getId getId getId createRelativeResourceUrl assertResultsPresentInDataResponse getId createRelativeResourceUrl assertResultsPresentInDataResponse getId createRelativeResourceUrl assertResultsPresentInDataResponse getId createRelativeResourceUrl assertResultsPresentInDataResponse getId createRelativeResourceUrl assertResultsPresentInDataResponse getId createRelativeResourceUrl encode assertResultsPresentInDataResponse getId createRelativeResourceUrl encode assertResultsPresentInDataResponse getId createRelativeResourceUrl encode assertResultsPresentInDataResponse getId createRelativeResourceUrl encode assertResultsPresentInDataResponse getId createRelativeResourceUrl assertResultsPresentInDataResponse getId isEmpty deleteUser getId
test_case.modifiers: @Test @Deployment public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetUsers()
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/UserCollectionResource.java
focal_class.identifier: UserCollectionResource
focal_class.class_method_signature: UserCollectionResource.getUsers(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_class.full_signature: @ApiOperation(value = "List users", nickname = "listUsers", tags = { "Users" }) @ApiImplicitParams({ @ApiImplicitParam(name = "id", dataType = "string", value = "Only return group with the given id", paramType = "query"), @ApiImplicitParam(name = "firstName", dataType = "string", value = "Only return users with the given firstname", paramType = "query"), @ApiImplicitParam(name = "lastName", dataType = "string", value = "Only return users with the given lastname", paramType = "query"), @ApiImplicitParam(name = "displayName", dataType = "string", value = "Only return users with the given displayName", paramType = "query"), @ApiImplicitParam(name = "email", dataType = "string", value = "Only return users with the given email", paramType = "query"), @ApiImplicitParam(name = "firstNameLike", dataType = "string", value = "Only return userswith a firstname like the given value. Use % as wildcard-character.", paramType = "query"), @ApiImplicitParam(name = "lastNameLike", dataType = "string", value = "Only return users with a lastname like the given value. Use % as wildcard-character.", paramType = "query"), @ApiImplicitParam(name = "displayNameLike", dataType = "string", value = "Only return users with a displayName like the given value. Use % as wildcard-character.", paramType = "query"), @ApiImplicitParam(name = "emailLike", dataType = "string", value = "Only return users with an email like the given value. Use % as wildcard-character.", paramType = "query"), @ApiImplicitParam(name = "memberOfGroup", dataType = "string", value = "Only return users which are a member of the given group.", paramType = "query"), @ApiImplicitParam(name = "tenantId", dataType = "string", value = "Only return users which are a members of the given tenant.", paramType = "query"), @ApiImplicitParam(name = "potentialStarter", dataType = "string", value = "Only return users 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,firstName,lastname,email,displayName", paramType = "query"), }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the group exists and is returned.") }) @GetMapping(value = "/identity/users", produces = "application/json") public DataResponse<UserResponse> getUsers(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_class.identifier: getUsers
focal_class.modifiers: @ApiOperation(value = "List users", nickname = "listUsers", tags = { "Users" }) @ApiImplicitParams({ @ApiImplicitParam(name = "id", dataType = "string", value = "Only return group with the given id", paramType = "query"), @ApiImplicitParam(name = "firstName", dataType = "string", value = "Only return users with the given firstname", paramType = "query"), @ApiImplicitParam(name = "lastName", dataType = "string", value = "Only return users with the given lastname", paramType = "query"), @ApiImplicitParam(name = "displayName", dataType = "string", value = "Only return users with the given displayName", paramType = "query"), @ApiImplicitParam(name = "email", dataType = "string", value = "Only return users with the given email", paramType = "query"), @ApiImplicitParam(name = "firstNameLike", dataType = "string", value = "Only return userswith a firstname like the given value. Use % as wildcard-character.", paramType = "query"), @ApiImplicitParam(name = "lastNameLike", dataType = "string", value = "Only return users with a lastname like the given value. Use % as wildcard-character.", paramType = "query"), @ApiImplicitParam(name = "displayNameLike", dataType = "string", value = "Only return users with a displayName like the given value. Use % as wildcard-character.", paramType = "query"), @ApiImplicitParam(name = "emailLike", dataType = "string", value = "Only return users with an email like the given value. Use % as wildcard-character.", paramType = "query"), @ApiImplicitParam(name = "memberOfGroup", dataType = "string", value = "Only return users which are a member of the given group.", paramType = "query"), @ApiImplicitParam(name = "tenantId", dataType = "string", value = "Only return users which are a members of the given tenant.", paramType = "query"), @ApiImplicitParam(name = "potentialStarter", dataType = "string", value = "Only return users 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,firstName,lastname,email,displayName", paramType = "query"), }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the group exists and is returned.") }) @GetMapping(value = "/identity/users", produces = "application/json") public
focal_class.parameters: (@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_class.return: DataResponse<UserResponse>
focal_class.signature: DataResponse<UserResponse> getUsers(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_class.class_method_signature: UserCollectionResource.createUser(@RequestBody UserRequest userRequest, HttpServletRequest request, HttpServletResponse response)
focal_class.full_signature: @ApiOperation(value = "Create a user", tags = { "Users" }) @ApiResponses(value = { @ApiResponse(code = 201, message = "Indicates the user was created."), @ApiResponse(code = 400, message = "Indicates the id of the user was missing.") }) @PostMapping(value = "/identity/users", produces = "application/json") public UserResponse createUser(@RequestBody UserRequest userRequest, HttpServletRequest request, HttpServletResponse response)
focal_class.identifier: createUser
focal_class.modifiers: @ApiOperation(value = "Create a user", tags = { "Users" }) @ApiResponses(value = { @ApiResponse(code = 201, message = "Indicates the user was created."), @ApiResponse(code = 400, message = "Indicates the id of the user was missing.") }) @PostMapping(value = "/identity/users", produces = "application/json") public
focal_class.parameters: (@RequestBody UserRequest userRequest, HttpServletRequest request, HttpServletResponse response)
focal_class.return: UserResponse
focal_class.signature: UserResponse createUser(@RequestBody UserRequest userRequest, HttpServletRequest request, HttpServletResponse response)
focal_method.body: @ApiOperation(value = "List users", nickname = "listUsers", tags = { "Users" })
      @ApiImplicitParams({
              @ApiImplicitParam(name = "id", dataType = "string", value = "Only return group with the given id", paramType = "query"),
              @ApiImplicitParam(name = "firstName", dataType = "string", value = "Only return users with the given firstname", paramType = "query"),
              @ApiImplicitParam(name = "lastName", dataType = "string", value = "Only return users with the given lastname", paramType = "query"),
              @ApiImplicitParam(name = "displayName", dataType = "string", value = "Only return users with the given displayName", paramType = "query"),
              @ApiImplicitParam(name = "email", dataType = "string", value = "Only return users with the given email", paramType = "query"),
              @ApiImplicitParam(name = "firstNameLike", dataType = "string", value = "Only return userswith a firstname like the given value. Use % as wildcard-character.", paramType = "query"),
              @ApiImplicitParam(name = "lastNameLike", dataType = "string", value = "Only return users with a lastname like the given value. Use % as wildcard-character.", paramType = "query"),
              @ApiImplicitParam(name = "displayNameLike", dataType = "string", value = "Only return users with a displayName like the given value. Use % as wildcard-character.", paramType = "query"),
              @ApiImplicitParam(name = "emailLike", dataType = "string", value = "Only return users with an email like the given value. Use % as wildcard-character.", paramType = "query"),
              @ApiImplicitParam(name = "memberOfGroup", dataType = "string", value = "Only return users which are a member of the given group.", paramType = "query"),
              @ApiImplicitParam(name = "tenantId", dataType = "string", value = "Only return users which are a members of the given tenant.", paramType = "query"),
              @ApiImplicitParam(name = "potentialStarter", dataType = "string", value = "Only return users  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,firstName,lastname,email,displayName", paramType = "query"),
      })
      @ApiResponses(value = {
              @ApiResponse(code = 200, message = "Indicates the group exists and is returned.")
      })
      @GetMapping(value = "/identity/users", produces = "application/json")
      public DataResponse<UserResponse> getUsers(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request) {
          UserQuery query = identityService.createUserQuery();
  
          if (allRequestParams.containsKey("id")) {
              query.userId(allRequestParams.get("id"));
          }
          if (allRequestParams.containsKey("firstName")) {
              query.userFirstName(allRequestParams.get("firstName"));
          }
          if (allRequestParams.containsKey("lastName")) {
              query.userLastName(allRequestParams.get("lastName"));
          }
          if (allRequestParams.containsKey("displayName")) {
              query.userDisplayName(allRequestParams.get("displayName"));
          }
          if (allRequestParams.containsKey("email")) {
              query.userEmail(allRequestParams.get("email"));
          }
          if (allRequestParams.containsKey("firstNameLike")) {
              query.userFirstNameLike(allRequestParams.get("firstNameLike"));
          }
          if (allRequestParams.containsKey("lastNameLike")) {
              query.userLastNameLike(allRequestParams.get("lastNameLike"));
          }
          if (allRequestParams.containsKey("displayNameLike")) {
              query.userDisplayNameLike(allRequestParams.get("displayNameLike"));
          }
          if (allRequestParams.containsKey("emailLike")) {
              query.userEmailLike(allRequestParams.get("emailLike"));
          }
          if (allRequestParams.containsKey("memberOfGroup")) {
              query.memberOfGroup(allRequestParams.get("memberOfGroup"));
          }
          if (allRequestParams.containsKey("tenantId")) {
              query.tenantId(allRequestParams.get("tenantId"));
          }
          
          if (restApiInterceptor != null) {
              restApiInterceptor.accessUserInfoWithQuery(query);
          }
  
          return paginateList(allRequestParams, query, "id", properties, restResponseFactory::createUserResponseList);
      }
focal_method.class_method_signature: UserCollectionResource.getUsers(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_method.full_signature: @ApiOperation(value = "List users", nickname = "listUsers", tags = { "Users" }) @ApiImplicitParams({ @ApiImplicitParam(name = "id", dataType = "string", value = "Only return group with the given id", paramType = "query"), @ApiImplicitParam(name = "firstName", dataType = "string", value = "Only return users with the given firstname", paramType = "query"), @ApiImplicitParam(name = "lastName", dataType = "string", value = "Only return users with the given lastname", paramType = "query"), @ApiImplicitParam(name = "displayName", dataType = "string", value = "Only return users with the given displayName", paramType = "query"), @ApiImplicitParam(name = "email", dataType = "string", value = "Only return users with the given email", paramType = "query"), @ApiImplicitParam(name = "firstNameLike", dataType = "string", value = "Only return userswith a firstname like the given value. Use % as wildcard-character.", paramType = "query"), @ApiImplicitParam(name = "lastNameLike", dataType = "string", value = "Only return users with a lastname like the given value. Use % as wildcard-character.", paramType = "query"), @ApiImplicitParam(name = "displayNameLike", dataType = "string", value = "Only return users with a displayName like the given value. Use % as wildcard-character.", paramType = "query"), @ApiImplicitParam(name = "emailLike", dataType = "string", value = "Only return users with an email like the given value. Use % as wildcard-character.", paramType = "query"), @ApiImplicitParam(name = "memberOfGroup", dataType = "string", value = "Only return users which are a member of the given group.", paramType = "query"), @ApiImplicitParam(name = "tenantId", dataType = "string", value = "Only return users which are a members of the given tenant.", paramType = "query"), @ApiImplicitParam(name = "potentialStarter", dataType = "string", value = "Only return users 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,firstName,lastname,email,displayName", paramType = "query"), }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the group exists and is returned.") }) @GetMapping(value = "/identity/users", produces = "application/json") public DataResponse<UserResponse> getUsers(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_method.identifier: getUsers
focal_method.invocations: createUserQuery containsKey userId get containsKey userFirstName get containsKey userLastName get containsKey userDisplayName get containsKey userEmail get containsKey userFirstNameLike get containsKey userLastNameLike get containsKey userDisplayNameLike get containsKey userEmailLike get containsKey memberOfGroup get containsKey tenantId get accessUserInfoWithQuery paginateList
focal_method.modifiers: @ApiOperation(value = "List users", nickname = "listUsers", tags = { "Users" }) @ApiImplicitParams({ @ApiImplicitParam(name = "id", dataType = "string", value = "Only return group with the given id", paramType = "query"), @ApiImplicitParam(name = "firstName", dataType = "string", value = "Only return users with the given firstname", paramType = "query"), @ApiImplicitParam(name = "lastName", dataType = "string", value = "Only return users with the given lastname", paramType = "query"), @ApiImplicitParam(name = "displayName", dataType = "string", value = "Only return users with the given displayName", paramType = "query"), @ApiImplicitParam(name = "email", dataType = "string", value = "Only return users with the given email", paramType = "query"), @ApiImplicitParam(name = "firstNameLike", dataType = "string", value = "Only return userswith a firstname like the given value. Use % as wildcard-character.", paramType = "query"), @ApiImplicitParam(name = "lastNameLike", dataType = "string", value = "Only return users with a lastname like the given value. Use % as wildcard-character.", paramType = "query"), @ApiImplicitParam(name = "displayNameLike", dataType = "string", value = "Only return users with a displayName like the given value. Use % as wildcard-character.", paramType = "query"), @ApiImplicitParam(name = "emailLike", dataType = "string", value = "Only return users with an email like the given value. Use % as wildcard-character.", paramType = "query"), @ApiImplicitParam(name = "memberOfGroup", dataType = "string", value = "Only return users which are a member of the given group.", paramType = "query"), @ApiImplicitParam(name = "tenantId", dataType = "string", value = "Only return users which are a members of the given tenant.", paramType = "query"), @ApiImplicitParam(name = "potentialStarter", dataType = "string", value = "Only return users 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,firstName,lastname,email,displayName", paramType = "query"), }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the group exists and is returned.") }) @GetMapping(value = "/identity/users", produces = "application/json") public
focal_method.parameters: (@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_method.return: DataResponse<UserResponse>
focal_method.signature: DataResponse<UserResponse> getUsers(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)