@Test public void getTodayStatisticsForAllHabitItemsStatusCodeTest() throws Exception { when(habitStatisticService.getTodayStatisticsForAllHabitItems(anyString())) .thenReturn(Collections.singletonList((new HabitItemsAmountStatisticDto()))); mockMvc.perform(get(habitStatisticLink + "todayStatisticsForAllHabitItems")) .andExpect(status().isOk()); }
@ApiOperation(value = "Get today's statistic for all habit items") @ApiResponses(value = { @ApiResponse(code = 200, message = HttpStatuses.OK, response = List.class), @ApiResponse(code = 303, message = HttpStatuses.SEE_OTHER), @ApiResponse(code = 400, message = HttpStatuses.BAD_REQUEST), @ApiResponse(code = 403, message = HttpStatuses.FORBIDDEN), }) @GetMapping("/statistic/todayStatisticsForAllHabitItems") public ResponseEntity<List<HabitItemsAmountStatisticDto>> getTodayStatisticsForAllHabitItems( @ApiParam(value = "Requested language code") @RequestParam(defaultValue = "en") String language ) { return ResponseEntity.status(HttpStatus.OK) .body(habitStatisticService.getTodayStatisticsForAllHabitItems(language)); }
HabitStatisticController { @ApiOperation(value = "Get today's statistic for all habit items") @ApiResponses(value = { @ApiResponse(code = 200, message = HttpStatuses.OK, response = List.class), @ApiResponse(code = 303, message = HttpStatuses.SEE_OTHER), @ApiResponse(code = 400, message = HttpStatuses.BAD_REQUEST), @ApiResponse(code = 403, message = HttpStatuses.FORBIDDEN), }) @GetMapping("/statistic/todayStatisticsForAllHabitItems") public ResponseEntity<List<HabitItemsAmountStatisticDto>> getTodayStatisticsForAllHabitItems( @ApiParam(value = "Requested language code") @RequestParam(defaultValue = "en") String language ) { return ResponseEntity.status(HttpStatus.OK) .body(habitStatisticService.getTodayStatisticsForAllHabitItems(language)); } }
HabitStatisticController { @ApiOperation(value = "Get today's statistic for all habit items") @ApiResponses(value = { @ApiResponse(code = 200, message = HttpStatuses.OK, response = List.class), @ApiResponse(code = 303, message = HttpStatuses.SEE_OTHER), @ApiResponse(code = 400, message = HttpStatuses.BAD_REQUEST), @ApiResponse(code = 403, message = HttpStatuses.FORBIDDEN), }) @GetMapping("/statistic/todayStatisticsForAllHabitItems") public ResponseEntity<List<HabitItemsAmountStatisticDto>> getTodayStatisticsForAllHabitItems( @ApiParam(value = "Requested language code") @RequestParam(defaultValue = "en") String language ) { return ResponseEntity.status(HttpStatus.OK) .body(habitStatisticService.getTodayStatisticsForAllHabitItems(language)); }  }
HabitStatisticController { @ApiOperation(value = "Get today's statistic for all habit items") @ApiResponses(value = { @ApiResponse(code = 200, message = HttpStatuses.OK, response = List.class), @ApiResponse(code = 303, message = HttpStatuses.SEE_OTHER), @ApiResponse(code = 400, message = HttpStatuses.BAD_REQUEST), @ApiResponse(code = 403, message = HttpStatuses.FORBIDDEN), }) @GetMapping("/statistic/todayStatisticsForAllHabitItems") public ResponseEntity<List<HabitItemsAmountStatisticDto>> getTodayStatisticsForAllHabitItems( @ApiParam(value = "Requested language code") @RequestParam(defaultValue = "en") String language ) { return ResponseEntity.status(HttpStatus.OK) .body(habitStatisticService.getTodayStatisticsForAllHabitItems(language)); }  @ApiOperation(value = "Add habit statistic.") @ApiResponses(value = { @ApiResponse(code = 201, message = HttpStatuses.CREATED, response = AddHabitStatisticDto.class), @ApiResponse(code = 303, message = HttpStatuses.SEE_OTHER), @ApiResponse(code = 403, message = HttpStatuses.FORBIDDEN), }) @PostMapping("/statistic/") ResponseEntity<Object> save(@Valid @RequestBody AddHabitStatisticDto addHabitStatisticDto); @ApiOperation(value = "Update habit statistic.") @ApiResponses(value = { @ApiResponse(code = 201, message = HttpStatuses.CREATED), @ApiResponse(code = 303, message = HttpStatuses.SEE_OTHER), @ApiResponse(code = 403, message = HttpStatuses.FORBIDDEN) }) @PatchMapping("/statistic/{habitStatisticId}") ResponseEntity<UpdateHabitStatisticDto> update(
        @PathVariable Long habitStatisticId, @Valid @RequestBody UpdateHabitStatisticDto habitStatisticForUpdateDto); @ApiOperation(value = "Find statistic by habit id.") @GetMapping("/statistic/{habitId}") ResponseEntity<List<HabitStatisticDto>> findAllByHabitId(
        @PathVariable Long habitId); @ApiOperation(value = "Get today's statistic for all habit items") @ApiResponses(value = { @ApiResponse(code = 200, message = HttpStatuses.OK, response = List.class), @ApiResponse(code = 303, message = HttpStatuses.SEE_OTHER), @ApiResponse(code = 400, message = HttpStatuses.BAD_REQUEST), @ApiResponse(code = 403, message = HttpStatuses.FORBIDDEN), }) @GetMapping("/statistic/todayStatisticsForAllHabitItems") ResponseEntity<List<HabitItemsAmountStatisticDto>> getTodayStatisticsForAllHabitItems(
        @ApiParam(value = "Requested language code")
        @RequestParam(defaultValue = "en") String language
    ); }
HabitStatisticController { @ApiOperation(value = "Get today's statistic for all habit items") @ApiResponses(value = { @ApiResponse(code = 200, message = HttpStatuses.OK, response = List.class), @ApiResponse(code = 303, message = HttpStatuses.SEE_OTHER), @ApiResponse(code = 400, message = HttpStatuses.BAD_REQUEST), @ApiResponse(code = 403, message = HttpStatuses.FORBIDDEN), }) @GetMapping("/statistic/todayStatisticsForAllHabitItems") public ResponseEntity<List<HabitItemsAmountStatisticDto>> getTodayStatisticsForAllHabitItems( @ApiParam(value = "Requested language code") @RequestParam(defaultValue = "en") String language ) { return ResponseEntity.status(HttpStatus.OK) .body(habitStatisticService.getTodayStatisticsForAllHabitItems(language)); }  @ApiOperation(value = "Add habit statistic.") @ApiResponses(value = { @ApiResponse(code = 201, message = HttpStatuses.CREATED, response = AddHabitStatisticDto.class), @ApiResponse(code = 303, message = HttpStatuses.SEE_OTHER), @ApiResponse(code = 403, message = HttpStatuses.FORBIDDEN), }) @PostMapping("/statistic/") ResponseEntity<Object> save(@Valid @RequestBody AddHabitStatisticDto addHabitStatisticDto); @ApiOperation(value = "Update habit statistic.") @ApiResponses(value = { @ApiResponse(code = 201, message = HttpStatuses.CREATED), @ApiResponse(code = 303, message = HttpStatuses.SEE_OTHER), @ApiResponse(code = 403, message = HttpStatuses.FORBIDDEN) }) @PatchMapping("/statistic/{habitStatisticId}") ResponseEntity<UpdateHabitStatisticDto> update(
        @PathVariable Long habitStatisticId, @Valid @RequestBody UpdateHabitStatisticDto habitStatisticForUpdateDto); @ApiOperation(value = "Find statistic by habit id.") @GetMapping("/statistic/{habitId}") ResponseEntity<List<HabitStatisticDto>> findAllByHabitId(
        @PathVariable Long habitId); @ApiOperation(value = "Get today's statistic for all habit items") @ApiResponses(value = { @ApiResponse(code = 200, message = HttpStatuses.OK, response = List.class), @ApiResponse(code = 303, message = HttpStatuses.SEE_OTHER), @ApiResponse(code = 400, message = HttpStatuses.BAD_REQUEST), @ApiResponse(code = 403, message = HttpStatuses.FORBIDDEN), }) @GetMapping("/statistic/todayStatisticsForAllHabitItems") ResponseEntity<List<HabitItemsAmountStatisticDto>> getTodayStatisticsForAllHabitItems(
        @ApiParam(value = "Requested language code")
        @RequestParam(defaultValue = "en") String language
    );  }