test_class.file: modules/flowable-rest/src/test/java/org/flowable/rest/service/api/identity/UserResourceTest.java
test_class.identifier: UserResourceTest
test_class.superclass: extends BaseSpringRestTestCase
test_case.body: @Test
      public void testGetUser() throws Exception {
          User savedUser = null;
          try {
              User newUser = identityService.newUser("testuser");
              newUser.setFirstName("Fred");
              newUser.setLastName("McDonald");
              newUser.setDisplayName("Fred McDonald");
              newUser.setEmail("no-reply@flowable.org");
              identityService.saveUser(newUser);
              savedUser = newUser;
  
              CloseableHttpResponse response = executeRequest(
                      new HttpGet(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_USER, newUser.getId())), HttpStatus.SC_OK);
  
              JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
              closeResponse(response);
              assertThat(responseNode).isNotNull();
              assertThatJson(responseNode)
                      .when(Option.IGNORING_EXTRA_FIELDS)
                      .isEqualTo("{"
                              + "id: 'testuser',"
                              + "firstName: 'Fred',"
                              + "lastName: 'McDonald',"
                              + "displayName: 'Fred McDonald',"
                              + "email: 'no-reply@flowable.org',"
                              + "url: '" + SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_USER, newUser.getId()) + "'"
                              + "}");
  
          } finally {
  
              // Delete user after test passes or fails
              if (savedUser != null) {
                  identityService.deleteUser(savedUser.getId());
              }
          }
      }
test_case.class_method_signature: UserResourceTest.testGetUser()
test_case.full_signature: @Test public void testGetUser()
test_case.identifier: testGetUser
test_case.invocations: newUser setFirstName setLastName setDisplayName setEmail saveUser executeRequest createRelativeResourceUrl getId readTree getContent getEntity closeResponse isNotNull assertThat isEqualTo when assertThatJson createRelativeResourceUrl getId deleteUser getId
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetUser()
focal_class.file: modules/flowable-rest/src/main/java/org/flowable/rest/service/api/identity/UserResource.java
focal_class.identifier: UserResource
focal_class.class_method_signature: UserResource.getUser(@ApiParam(name = "userId") @PathVariable String userId, HttpServletRequest request)
focal_class.full_signature: @ApiOperation(value = "Get a single user", tags = { "Users" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the user exists and is returned."), @ApiResponse(code = 404, message = "Indicates the requested user does not exist.") }) @GetMapping(value = "/identity/users/{userId}", produces = "application/json") public UserResponse getUser(@ApiParam(name = "userId") @PathVariable String userId, HttpServletRequest request)
focal_class.identifier: getUser
focal_class.modifiers: @ApiOperation(value = "Get a single user", tags = { "Users" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the user exists and is returned."), @ApiResponse(code = 404, message = "Indicates the requested user does not exist.") }) @GetMapping(value = "/identity/users/{userId}", produces = "application/json") public
focal_class.parameters: (@ApiParam(name = "userId") @PathVariable String userId, HttpServletRequest request)
focal_class.return: UserResponse
focal_class.signature: UserResponse getUser(@ApiParam(name = "userId") @PathVariable String userId, HttpServletRequest request)
focal_class.class_method_signature: UserResource.updateUser(@ApiParam(name = "userId") @PathVariable String userId, @RequestBody UserRequest userRequest, HttpServletRequest request)
focal_class.full_signature: @ApiOperation(value = "Update a user", tags = { "Users" }, notes = "All request values are optional. " + "For example, you can only include the firstName attribute in the request body JSON-object, only updating the firstName of the user, leaving all other fields unaffected. " + "When an attribute is explicitly included and is set to null, the user-value will be updated to null. " + "Example: {\"firstName\" : null} will clear the firstName of the user).") @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the user was updated."), @ApiResponse(code = 404, message = "Indicates the requested user was not found."), @ApiResponse(code = 409, message = "Indicates the requested user was updated simultaneously.") }) @PutMapping(value = "/identity/users/{userId}", produces = "application/json") public UserResponse updateUser(@ApiParam(name = "userId") @PathVariable String userId, @RequestBody UserRequest userRequest, HttpServletRequest request)
focal_class.identifier: updateUser
focal_class.modifiers: @ApiOperation(value = "Update a user", tags = { "Users" }, notes = "All request values are optional. " + "For example, you can only include the firstName attribute in the request body JSON-object, only updating the firstName of the user, leaving all other fields unaffected. " + "When an attribute is explicitly included and is set to null, the user-value will be updated to null. " + "Example: {\"firstName\" : null} will clear the firstName of the user).") @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the user was updated."), @ApiResponse(code = 404, message = "Indicates the requested user was not found."), @ApiResponse(code = 409, message = "Indicates the requested user was updated simultaneously.") }) @PutMapping(value = "/identity/users/{userId}", produces = "application/json") public
focal_class.parameters: (@ApiParam(name = "userId") @PathVariable String userId, @RequestBody UserRequest userRequest, HttpServletRequest request)
focal_class.return: UserResponse
focal_class.signature: UserResponse updateUser(@ApiParam(name = "userId") @PathVariable String userId, @RequestBody UserRequest userRequest, HttpServletRequest request)
focal_class.class_method_signature: UserResource.deleteUser(@ApiParam(name = "userId") @PathVariable String userId, HttpServletResponse response)
focal_class.full_signature: @ApiOperation(value = "Delete a user", tags = { "Users" }) @ApiResponses(value = { @ApiResponse(code = 204, message = "Indicates the user was found and has been deleted. Response-body is intentionally empty."), @ApiResponse(code = 404, message = "Indicates the requested user was not found.") }) @DeleteMapping("/identity/users/{userId}") public void deleteUser(@ApiParam(name = "userId") @PathVariable String userId, HttpServletResponse response)
focal_class.identifier: deleteUser
focal_class.modifiers: @ApiOperation(value = "Delete a user", tags = { "Users" }) @ApiResponses(value = { @ApiResponse(code = 204, message = "Indicates the user was found and has been deleted. Response-body is intentionally empty."), @ApiResponse(code = 404, message = "Indicates the requested user was not found.") }) @DeleteMapping("/identity/users/{userId}") public
focal_class.parameters: (@ApiParam(name = "userId") @PathVariable String userId, HttpServletResponse response)
focal_class.return: void
focal_class.signature: void deleteUser(@ApiParam(name = "userId") @PathVariable String userId, HttpServletResponse response)
focal_class.superclass: extends BaseUserResource
focal_method.body: @ApiOperation(value = "Get a single user", tags = { "Users" })
      @ApiResponses(value = {
              @ApiResponse(code = 200, message = "Indicates the user exists and is returned."),
              @ApiResponse(code = 404, message = "Indicates the requested user does not exist.")
      })
      @GetMapping(value = "/identity/users/{userId}", produces = "application/json")
      public UserResponse getUser(@ApiParam(name = "userId") @PathVariable String userId, HttpServletRequest request) {
          return restResponseFactory.createUserResponse(getUserFromRequest(userId), false);
      }
focal_method.class_method_signature: UserResource.getUser(@ApiParam(name = "userId") @PathVariable String userId, HttpServletRequest request)
focal_method.full_signature: @ApiOperation(value = "Get a single user", tags = { "Users" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the user exists and is returned."), @ApiResponse(code = 404, message = "Indicates the requested user does not exist.") }) @GetMapping(value = "/identity/users/{userId}", produces = "application/json") public UserResponse getUser(@ApiParam(name = "userId") @PathVariable String userId, HttpServletRequest request)
focal_method.identifier: getUser
focal_method.invocations: createUserResponse getUserFromRequest
focal_method.modifiers: @ApiOperation(value = "Get a single user", tags = { "Users" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the user exists and is returned."), @ApiResponse(code = 404, message = "Indicates the requested user does not exist.") }) @GetMapping(value = "/identity/users/{userId}", produces = "application/json") public
focal_method.parameters: (@ApiParam(name = "userId") @PathVariable String userId, HttpServletRequest request)
focal_method.return: UserResponse
focal_method.signature: UserResponse getUser(@ApiParam(name = "userId") @PathVariable String userId, HttpServletRequest request)