@ApiOperation(value = "Get a single group", tags = { "Groups" })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "Indicates the group exists and is returned."),
            @ApiResponse(code = 404, message = "Indicates the requested group does not exist.")
    })
    @GetMapping(value = "/identity/groups/{groupId}", produces = "application/json")
    public GroupResponse getGroup(@ApiParam(name = "groupId") @PathVariable String groupId) {
        return restResponseFactory.createGroupResponse(getGroupFromRequest(groupId));
    }
@Test
    public void testGetGroup() throws Exception {
        try {
            Group testGroup = identityService.newGroup("testgroup");
            testGroup.setName("Test group");
            testGroup.setType("Test type");
            identityService.saveGroup(testGroup);

            CloseableHttpResponse response = executeRequest(
                    new HttpGet(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_GROUP, "testgroup")), HttpStatus.SC_OK);

            JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
            closeResponse(response);
            assertThat(responseNode).isNotNull();
            assertThatJson(responseNode)
                    .when(Option.IGNORING_EXTRA_FIELDS)
                    .isEqualTo("{"
                            + " id: 'testgroup',"
                            + " name: 'Test group',"
                            + " type: 'Test type',"
                            + " url: '" + SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_GROUP, testGroup.getId()) + "'"
                            + "}");

            Group createdGroup = identityService.createGroupQuery().groupId("testgroup").singleResult();
            assertThat(createdGroup).isNotNull();
            assertThat(createdGroup.getName()).isEqualTo("Test group");
            assertThat(createdGroup.getType()).isEqualTo("Test type");

        } finally {
            try {
                identityService.deleteGroup("testgroup");
            } catch (Throwable ignore) {
                // Ignore, since the group may not have been created in the test
                // or already deleted
            }
        }
    }