assertSame(writer, context.getWriter("text/plain"));
}
@Test
public void requestContext_getOutputStream() throws IOException {
RequestContext context = new MyRequest("http://localhost", "/dummy.txt");
try {
context.getOutputStream();
fail();
} catch (IllegalStateException e) {
assertThat(e, exception("call getOutputStream(contentType) first"));
}
OutputStream stream = context.getOutputStream("text/plain");
assertSame(stream, context.getOutputStream());
assertSame(stream, context.getOutputStream("text/plain"));
}