### Question:
DashboardApiController { @PostMapping("/dashboard/api/v2/methods") public GetMethodsResponse2 getMethods2(@Valid @RequestBody GetMethodsRequest request) { logger.debug("Request: {}", request); GetMethodsResponse2 response = dashboardService.getMethods2(request); logger.trace("Response: {}", response); return response; }  @ExceptionHandler ResponseEntity<String> onConstraintValidationException(ConstraintViolationException e); @GetMapping("/dashboard/api/v1/serverSettings") ServerSettings getServerSettings(); @PostMapping("/dashboard/api/v2/methods") GetMethodsResponse2 getMethods2(@Valid @RequestBody GetMethodsRequest request); @GetMapping("/dashboard/api/v1/method/detail/{id}") ResponseEntity<MethodDescriptor1> getMethod1(@PathVariable(value = "id") Long methodId); @GetMapping("/dashboard/api/v1/status") GetStatusResponse getStatus1(); @GetMapping("/dashboard/api/v1/methodsFormData") GetMethodsFormData getMethodsFormData();  }### Answer:
@Test public void should_getMethods_V2() throws Exception { GetMethodsRequest request = GetMethodsRequest.defaults().toBuilder().signature("some signature").build(); when(dashboardService.getMethods2(request)) .thenReturn(GetMethodsResponse2.builder().methods(emptyList()).build()); mockMvc .perform( post("/dashboard/api/v2/methods") .accept(APPLICATION_JSON) .contentType(APPLICATION_JSON) .content(gson.toJson(request))) .andExpect(status().isOk()) .andExpect(content().contentType(APPLICATION_JSON_UTF8)) .andExpect(jsonPath("$.methods").isArray()); }