Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: eb3c51ae20
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (25 sloc) 0.622 kb
package co.freeside.betamax.util.servlet
import javax.servlet.ServletOutputStream
class MockServletOutputStream extends ServletOutputStream {
private final MockHttpServletResponse delegate
private final ByteArrayOutputStream stream = new ByteArrayOutputStream()
MockServletOutputStream(MockHttpServletResponse delegate) {
this.delegate = delegate
}
@Override
void write(int i) {
stream.write(i)
}
@Override
void flush() {
super.flush()
stream.flush()
delegate.body = stream.toByteArray()
}
@Override
void close() {
super.close()
stream.close()
delegate.body = stream.toByteArray()
}
}
Jump to Line
Something went wrong with that request. Please try again.