Search in sources :

Example 1 with ResteasyAsynchronousContext

use of org.jboss.resteasy.spi.ResteasyAsynchronousContext in project resteasy by resteasy.

the class SseBroadcasterTest method before.

@Before
public void before() {
    HttpRequest request = mock(HttpRequest.class);
    ResteasyAsynchronousContext resteasyAsynchronousContext = mock(ResteasyAsynchronousContext.class);
    doReturn(resteasyAsynchronousContext).when(request).getAsyncContext();
    // prevent NPE in SseEventOutputImpl ctr
    ResteasyContext.pushContext(org.jboss.resteasy.spi.HttpRequest.class, request);
}
Also used : HttpRequest(org.jboss.resteasy.spi.HttpRequest) MockHttpRequest(org.jboss.resteasy.mock.MockHttpRequest) ResteasyAsynchronousContext(org.jboss.resteasy.spi.ResteasyAsynchronousContext) Before(org.junit.Before)

Aggregations

MockHttpRequest (org.jboss.resteasy.mock.MockHttpRequest)1 HttpRequest (org.jboss.resteasy.spi.HttpRequest)1 ResteasyAsynchronousContext (org.jboss.resteasy.spi.ResteasyAsynchronousContext)1 Before (org.junit.Before)1