### Question:
WpsProcessExecuteController extends WpsReferenceController<E, D, S> { @RequestMapping(value = "preCheckDelete.action", method = RequestMethod.POST) public ResponseEntity<?> preCheckDelete(@RequestParam("wpsProcessId") Integer wpsProcessId) { List<String> result = null; try { result = service.preCheckDelete(wpsProcessId); } catch (Exception e) { final String msg = e.getMessage(); logger.error("Could not pre-check WpsProcessExecute deletion: " + msg); return new ResponseEntity<>(ResultSet.error(msg), HttpStatus.INTERNAL_SERVER_ERROR); } return new ResponseEntity<>(ResultSet.success(result), HttpStatus.OK); } @SuppressWarnings("unchecked")  WpsProcessExecuteController(); protected  WpsProcessExecuteController(Class<E> entityClass); @Override @Autowired @Qualifier("wpsProcessExecuteService") void setService(S service); @RequestMapping(value = "preCheckDelete.action", method = RequestMethod.POST) ResponseEntity<?> preCheckDelete(@RequestParam("wpsProcessId") Integer wpsProcessId);  }### Answer:
@Test public void preCheckDelete() throws Exception { final String resultMsg = "Everything fine."; final List<String> expectedResult = new ArrayList<>(); expectedResult.add(resultMsg); Mockito.when(wpsProcessExecuteService.preCheckDelete( Matchers.any(Integer.class)) ).thenReturn(expectedResult); String PRECHECKDELETE_ENDPOINT = "/wpsprocessexecutes/preCheckDelete.action"; MvcResult result = mockMvc.perform(MockMvcRequestBuilders.post(PRECHECKDELETE_ENDPOINT) .param("wpsProcessId", "1909") .contentType(MediaType.APPLICATION_FORM_URLENCODED) .accept(MediaType.APPLICATION_JSON)) .andExpect(MockMvcResultMatchers.status().isOk()).andReturn(); String content = result.getResponse().getContentAsString(); ObjectMapper objectMapper = new ObjectMapper(); Assert.assertEquals("Returned body matched mocked one.", objectMapper.writeValueAsString(ResultSet.success(expectedResult)), content); Mockito.verify(wpsProcessExecuteService, Mockito.times(1)). preCheckDelete(Matchers.any(Integer.class)); Mockito.verifyNoMoreInteractions(wpsProcessExecuteService); }