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 testUpdateUserNullFields() 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;
  
              ObjectNode taskUpdateRequest = objectMapper.createObjectNode();
              taskUpdateRequest.putNull("firstName");
              taskUpdateRequest.putNull("lastName");
              taskUpdateRequest.putNull("displayName");
              taskUpdateRequest.putNull("email");
              taskUpdateRequest.putNull("password");
  
              HttpPut httpPut = new HttpPut(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_USER, newUser.getId()));
              httpPut.setEntity(new StringEntity(taskUpdateRequest.toString()));
              CloseableHttpResponse response = executeRequest(httpPut, 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: null,"
                              + "lastName: null,"
                              + "displayName: null,"
                              + "email: null,"
                              + "url: '" + SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_USER, newUser.getId()) + "'"
                              + "}");
  
              // Check user is updated in Flowable
              newUser = identityService.createUserQuery().userId(newUser.getId()).singleResult();
              assertThat(newUser.getLastName()).isNull();
              assertThat(newUser.getFirstName()).isNull();
              assertThat(newUser.getDisplayName()).isNull();
              assertThat(newUser.getEmail()).isNull();
  
          } finally {
  
              // Delete user after test fails
              if (savedUser != null) {
                  identityService.deleteUser(savedUser.getId());
              }
          }
      }
test_case.class_method_signature: UserResourceTest.testUpdateUserNullFields()
test_case.full_signature: @Test public void testUpdateUserNullFields()
test_case.identifier: testUpdateUserNullFields
test_case.invocations: newUser setFirstName setLastName setDisplayName setEmail saveUser createObjectNode putNull putNull putNull putNull putNull createRelativeResourceUrl getId setEntity toString executeRequest readTree getContent getEntity closeResponse isNotNull assertThat isEqualTo when assertThatJson createRelativeResourceUrl getId singleResult userId createUserQuery getId isNull assertThat getLastName isNull assertThat getFirstName isNull assertThat getDisplayName isNull assertThat getEmail deleteUser getId
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testUpdateUserNullFields()
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 = "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) {
          User user = getUserFromRequest(userId);
          
          if (restApiInterceptor != null) {
              restApiInterceptor.deleteUser(user);
          }
          
          identityService.deleteUser(user.getId());
          response.setStatus(HttpStatus.NO_CONTENT.value());
      }
focal_method.class_method_signature: UserResource.deleteUser(@ApiParam(name = "userId") @PathVariable String userId, HttpServletResponse response)
focal_method.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_method.identifier: deleteUser
focal_method.invocations: getUserFromRequest deleteUser deleteUser getId setStatus value
focal_method.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_method.parameters: (@ApiParam(name = "userId") @PathVariable String userId, HttpServletResponse response)
focal_method.return: void
focal_method.signature: void deleteUser(@ApiParam(name = "userId") @PathVariable String userId, HttpServletResponse response)