@ApiOperation(value = "Delete a group", tags = { "Groups" }, code = 204)
    @ApiResponses(value = {
            @ApiResponse(code = 204, message = "Indicates the group was found and  has been deleted. Response-body is intentionally empty."),
            @ApiResponse(code = 404, message = "Indicates the requested group does not exist.")
    })
    @DeleteMapping("/identity/groups/{groupId}")
    @ResponseStatus(HttpStatus.NO_CONTENT)
    public void deleteGroup(@ApiParam(name = "groupId") @PathVariable String groupId) {
        Group group = getGroupFromRequest(groupId);
        
        if (restApiInterceptor != null) {
            restApiInterceptor.deleteGroup(group);
        }
        
        identityService.deleteGroup(group.getId());
    }
@Test
    public void testDeleteGroup() throws Exception {
        try {
            Group testGroup = identityService.newGroup("testgroup");
            testGroup.setName("Test group");
            testGroup.setType("Test type");
            identityService.saveGroup(testGroup);

            closeResponse(executeRequest(new HttpDelete(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_GROUP, "testgroup")), HttpStatus.SC_NO_CONTENT));

            assertThat(identityService.createGroupQuery().groupId("testgroup").singleResult()).isNull();

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