ThruStagingHandler extends AbstractStagingHandler { @Override public boolean canSendHeaders() { return getWrittenByteCount() > 0 ? false : true; } ThruStagingHandler( final OutputStream outputStream, final IPentahoSession userSession ); @Override void complete(); @Override void close(); @Override int getWrittenByteCount(); @Override boolean canSendHeaders(); @Override OutputStream getStagingOutputStream(); @Override boolean isFullyBuffered(); @Override StagingMode getStagingMode();  }
@Test public void testCanSendHeaders() throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ThruStagingHandler handler = new ThruStagingHandler( baos, session ); assertTrue( handler.canSendHeaders() ); handler.getStagingOutputStream().write( TEST.getBytes() ); assertFalse( "Can't send headers after start writing to THRU", handler.canSendHeaders() ); }