@GET
    @Path("stats")
    @Timed
    @ApiOperation(value = "Get stats of all index sets")
    @ApiResponses(value = {
            @ApiResponse(code = 403, message = "Unauthorized"),
    })
    public IndexSetStats globalStats() {
        checkPermission(RestPermissions.INDEXSETS_READ);
        return indices.getIndexSetStats();
    }
@Test
    public void globalStatsDenied() {
        notPermitted();

        expectedException.expect(ForbiddenException.class);
        expectedException.expectMessage("Not authorized");

        try {
            indexSetsResource.globalStats();
        } finally {
            verifyNoMoreInteractions(indexSetService);
        }
    }