open fun methodCall(obj: Any): ResultMatcher
Assert the controller method used to process the request.
The expected method is specified through a "mock" controller method invocation similar to MvcUriComponentsBuilder#fromMethodCall(Object).
For example, given this controller:
@RestController public class SimpleController { @RequestMapping("/") public ResponseEntity handle() { return ResponseEntity.ok().build(); } }
A test that has statically imported MvcUriComponentsBuilder#on can be performed as follows:
mockMvc.perform(get("/")) .andExpect(handler().methodCall(on(SimpleController.class).handle()));
obj - either the value returned from a "mock" controller invocation or the "mock" controller itself after an invocation