@ApiOperation(value = "Delete a user", tags = { "Users" }, code = 204)
    @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}")
    @ResponseStatus(HttpStatus.NO_CONTENT)
    public void deleteUser(@ApiParam(name = "userId") @PathVariable String userId) {
        User user = getUserFromRequest(userId);
        
        if (restApiInterceptor != null) {
            restApiInterceptor.deleteUser(user);
        }
        
        identityService.deleteUser(user.getId());
    }
@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());
            }
        }
    }