org.springframework.test.web.servlet.result

## Class HandlerResultMatchers

- java.lang.Object
- - org.springframework.test.web.servlet.result.HandlerResultMatchers

    public class HandlerResultMatchers
    extends Object

Factory for assertions on the selected handler. An instance of this class is typically accessed via `MockMvcResultMatchers.handler()`.

Since:
  3.2
Author:
  Rossen Stoyanchev

### Constructor Summary

Constructors
`protected` `HandlerResultMatchers()` Protected constructor.

### Method Summary

Methods
`ResultMatcher` `handlerType(Class<?> type)` Assert the type of the handler that processed the request.
`ResultMatcher` `method(Method method)` Assert the controller method that processed the request.
`ResultMatcher` `methodName(org.hamcrest.Matcher<? super String> matcher)` Assert the name of the controller method that processed the request with the given Hamcrest `Matcher`.
`ResultMatcher` `methodName(String name)` Assert the name of the controller method that processed the request.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### HandlerResultMatchers

    protected HandlerResultMatchers()

Protected constructor. Use `MockMvcResultMatchers.handler()`.

### Method Detail

#### handlerType

    public ResultMatcher handlerType(Class<?> type)

Assert the type of the handler that processed the request.

#### methodName

    public ResultMatcher methodName(org.hamcrest.Matcher<? super String> matcher)

Assert the name of the controller method that processed the request with the given Hamcrest `Matcher`.

Use of this method implies annotated controllers are processed with `RequestMappingHandlerMapping` and `RequestMappingHandlerAdapter`.

#### methodName

    public ResultMatcher methodName(String name)

Assert the name of the controller method that processed the request.

Use of this method implies annotated controllers are processed with `RequestMappingHandlerMapping` and `RequestMappingHandlerAdapter`.

#### method

    public ResultMatcher method(Method method)

Assert the controller method that processed the request.

Use of this method implies annotated controllers are processed with `RequestMappingHandlerMapping` and `RequestMappingHandlerAdapter`.