### Question:
LogController extends AbstractRestController { @RequestMapping(value = "/log/filter", method = RequestMethod.POST) @ResponseBody @ApiOperation( value = "Filter logs.", notes = "Filter logs.", produces = MediaType.APPLICATION_JSON_VALUE) @ApiResponses( value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION) }) public Result<LogPagination> filter(@RequestBody LogFilter logFilter) { return Result.success(logApiService.filter(logFilter)); }  @RequestMapping(value = "/log/filter", method = RequestMethod.POST) @ResponseBody @ApiOperation( value = "Filter logs.", notes = "Filter logs.", produces = MediaType.APPLICATION_JSON_VALUE) @ApiResponses( value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION) }) Result<LogPagination> filter(@RequestBody LogFilter logFilter); @RequestMapping(value = "/log/filter", method = RequestMethod.GET) @ResponseBody @ApiOperation( value = "Get possible values for filters.", notes = "Get possible values for filters.", produces = MediaType.APPLICATION_JSON_VALUE) @ApiResponses( value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION) }) Result<LogFilter> filter();  }### Answer:
@Test @WithMockUser public void shouldReturnFilteredLogs() throws Exception { final LogPagination logPagination = LogPagination.builder().pageSize(5).build(); logFilter.setMessage(TEST_MESSAGE); Mockito.doReturn(logPagination).when(mockLogApiService).filter(logFilter); final MvcResult mvcResult = mvc().perform(post(LOG_ENDPOINT) .servletPath(SERVLET_PATH) .contentType(EXPECTED_CONTENT_TYPE) .content(getObjectMapper().writeValueAsString(logFilter))) .andExpect(status().isOk()).andReturn(); Mockito.verify(mockLogApiService).filter(logFilter); final ArgumentCaptor<LogFilter> logFilterCaptor = ArgumentCaptor.forClass(LogFilter.class); Mockito.verify(mockLogApiService).filter(logFilterCaptor.capture()); assertThat(logFilterCaptor.getValue().getMessage()).isEqualTo(TEST_MESSAGE); final ResponseResult<LogPagination> expectedResult = ControllerTestUtils.buildExpectedResult(logPagination); ControllerTestUtils.assertResponse(mvcResult, getObjectMapper(), expectedResult, new TypeReference<Result<LogPagination>>() { }); }