Example usage for org.springframework.mock.web MockHttpServletRequest setDispatcherType

List of usage examples for org.springframework.mock.web MockHttpServletRequest setDispatcherType

Introduction

In this page you can find the example usage for org.springframework.mock.web MockHttpServletRequest setDispatcherType.

Prototype

public void setDispatcherType(DispatcherType dispatcherType) 

Source Link

Usage

From source file:org.zalando.logbook.servlet.RequestBuilders.java

static RequestBuilder async(final MvcResult result) {
    final RequestBuilder builder = asyncDispatch(result);

    return context -> {
        final MockHttpServletRequest request = builder.buildRequest(context);
        // this is missing in MockMvcRequestBuilders#asyncDispatch
        request.setDispatcherType(DispatcherType.ASYNC);
        return request;
    };/* w  w  w .  j  a  v  a2 s  . c  om*/
}