Package org.springframework.mock.web
Class MockAsyncContext
- java.lang.Object
 - org.springframework.mock.web.MockAsyncContext
 
- All Implemented Interfaces:
 AsyncContext
public class MockAsyncContext extends Object implements AsyncContext
Mock implementation of theAsyncContextinterface.- Since:
 - 3.2
 - Author:
 - Rossen Stoyanchev
 
Field Summary
Fields inherited from interface javax.servlet.AsyncContext
ASYNC_CONTEXT_PATH, ASYNC_PATH_INFO, ASYNC_QUERY_STRING, ASYNC_REQUEST_URI, ASYNC_SERVLET_PATH
Constructor Summary
Constructors Constructor Description MockAsyncContext(ServletRequest request, ServletResponse response)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDispatchHandler(Runnable handler)voidaddListener(AsyncListener listener)voidaddListener(AsyncListener listener, ServletRequest request, ServletResponse response)voidcomplete()<T extends AsyncListener>
TcreateListener(Class<T> clazz)voiddispatch()voiddispatch(String path)voiddispatch(ServletContext context, String path)StringgetDispatchedPath()List<AsyncListener>getListeners()ServletRequestgetRequest()ServletResponsegetResponse()longgetTimeout()booleanhasOriginalRequestAndResponse()voidsetTimeout(long timeout)voidstart(Runnable runnable)
Constructor Detail
MockAsyncContext
public MockAsyncContext(ServletRequest request, ServletResponse response)
Method Detail
addDispatchHandler
public void addDispatchHandler(Runnable handler)
getRequest
public ServletRequest getRequest()
- Specified by:
 getRequestin interfaceAsyncContext
getResponse
public ServletResponse getResponse()
- Specified by:
 getResponsein interfaceAsyncContext
hasOriginalRequestAndResponse
public boolean hasOriginalRequestAndResponse()
- Specified by:
 hasOriginalRequestAndResponsein interfaceAsyncContext
dispatch
public void dispatch()
- Specified by:
 dispatchin interfaceAsyncContext
dispatch
public void dispatch(String path)
- Specified by:
 dispatchin interfaceAsyncContext
dispatch
public void dispatch(ServletContext context, String path)
- Specified by:
 dispatchin interfaceAsyncContext
getDispatchedPath
public String getDispatchedPath()
complete
public void complete()
- Specified by:
 completein interfaceAsyncContext
start
public void start(Runnable runnable)
- Specified by:
 startin interfaceAsyncContext
addListener
public void addListener(AsyncListener listener)
- Specified by:
 addListenerin interfaceAsyncContext
addListener
public void addListener(AsyncListener listener, ServletRequest request, ServletResponse response)
- Specified by:
 addListenerin interfaceAsyncContext
getListeners
public List<AsyncListener> getListeners()
createListener
public <T extends AsyncListener> T createListener(Class<T> clazz) throws ServletException
- Specified by:
 createListenerin interfaceAsyncContext- Throws:
 ServletException
setTimeout
public void setTimeout(long timeout)
- Specified by:
 setTimeoutin interfaceAsyncContext
getTimeout
public long getTimeout()
- Specified by:
 getTimeoutin interfaceAsyncContext