@ApiOperation(value = "Get a user’s info", tags = { "Users" })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "Indicates the user was found and the user has info for the given key."),
            @ApiResponse(code = 404, message = "Indicates the requested user was not found or the user does ot have info for the given key. Status description contains additional information about the error.")
    })
    @GetMapping(value = "/identity/users/{userId}/info/{key}", produces = "application/json")
    public UserInfoResponse getUserInfo(@ApiParam(name = "userId") @PathVariable("userId") String userId, @ApiParam(name = "key") @PathVariable("key") String key) {
        User user = getUserFromRequest(userId);

        String existingValue = identityService.getUserInfo(user.getId(), key);
        if (existingValue == null) {
            throw new FlowableObjectNotFoundException("User info with key '" + key + "' does not exists for user '" + user.getId() + "'.", null);
        }

        return restResponseFactory.createUserInfoResponse(key, existingValue, user.getId());
    }
@Test
    public void testGetUserInfo() throws Exception {
        User savedUser = null;
        try {
            User newUser = identityService.newUser("testuser");
            newUser.setFirstName("Fred");
            newUser.setLastName("McDonald");
            newUser.setEmail("no-reply@flowable.org");
            identityService.saveUser(newUser);
            savedUser = newUser;

            identityService.setUserInfo(newUser.getId(), "key1", "Value 1");

            CloseableHttpResponse response = executeRequest(
                    new HttpGet(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_USER_INFO, newUser.getId(), "key1")), HttpStatus.SC_OK);
            JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
            closeResponse(response);
            assertThatJson(responseNode)
                    .isEqualTo("{"
                            + "key: 'key1',"
                            + "value: 'Value 1',"
                            + "url: '" + SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_USER_INFO, newUser.getId(), "key1") + "'"
                            + "}");

        } finally {

            // Delete user after test passes or fails
            if (savedUser != null) {
                identityService.deleteUser(savedUser.getId());
            }
        }
    }