StatusApi { @ApiOperation(value = "Get status", notes = "", nickname = "getStatus") @RequestMapping(produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET) @ResponseStatus(value = HttpStatus.OK) @ResponseBody public List<StatusValue> getStatus(HttpServletRequest request) throws Exception { ServiceContext context = ApiUtils.createServiceContext(request); return statusValueRepository.findAll(); }  @ApiOperation(value = "Get status", notes = "", nickname = "getStatus") @RequestMapping(produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET) @ResponseStatus(value = HttpStatus.OK) @ResponseBody List<StatusValue> getStatus(HttpServletRequest request); @ApiOperation(value = "Get status by type", notes = "", nickname = "getStatusByType") @RequestMapping(produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET, path = "/{type}") @ResponseStatus(value = HttpStatus.OK) @ResponseBody List<StatusValue> getStatusByType(
            @ApiParam(value = "Type", required = true) @PathVariable StatusValueType type, HttpServletRequest request); @ApiOperation(value = "Delete all record history and status", notes = "", nickname = "deleteAllHistoryAndStatus") @RequestMapping(method = RequestMethod.DELETE) @PreAuthorize("hasRole('Administrator')") @ApiResponses(value = { @ApiResponse(code = 204, message = "Status removed."), @ApiResponse(code = 403, message = ApiParams.API_RESPONSE_NOT_ALLOWED_ONLY_ADMIN) }) @ResponseStatus(HttpStatus.NO_CONTENT) void deleteAllHistoryAndStatus(
        HttpServletRequest request);  }
@Test public void getStatus() throws Exception { Long statusValueCount = statusValueRepo.count(); this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build(); this.mockHttpSession = loginAsAdmin(); this.mockMvc.perform(get("/srv/api/status") .accept(MediaType.parseMediaType("application/json")) .session(this.mockHttpSession)) .andExpect(status().isOk()) .andExpect(content().contentType(API_JSON_EXPECTED_ENCODING)) .andExpect(jsonPath("$", hasSize(statusValueCount.intValue()))); }