@Test public void testProcessShouldCallDecompressor() throws ApplicationException { given(entity.getHeader(GZIP_ENCODING)).willReturn(GZIP); given(entity.getInputStream()).willReturn(inputStream); given(decompressor.decompress(inputStream)).willReturn(body); underTest.process(entity); verify(decompressor).decompress(inputStream); }
@Override public void process(final WilmaHttpEntity entity) throws ApplicationException { if (isContentGzipEncoded(entity)) { ByteArrayOutputStream baos = decompressor.decompress(entity.getInputStream()); ByteArrayInputStream inputStream = new ByteArrayInputStream(baos.toByteArray()); entity.setInputStream(inputStream); entity.setBody(baos.toString()); } }
GzipDecompressorProcessor extends ProcessorBase { @Override public void process(final WilmaHttpEntity entity) throws ApplicationException { if (isContentGzipEncoded(entity)) { ByteArrayOutputStream baos = decompressor.decompress(entity.getInputStream()); ByteArrayInputStream inputStream = new ByteArrayInputStream(baos.toByteArray()); entity.setInputStream(inputStream); entity.setBody(baos.toString()); } } }
GzipDecompressorProcessor extends ProcessorBase { @Override public void process(final WilmaHttpEntity entity) throws ApplicationException { if (isContentGzipEncoded(entity)) { ByteArrayOutputStream baos = decompressor.decompress(entity.getInputStream()); ByteArrayInputStream inputStream = new ByteArrayInputStream(baos.toByteArray()); entity.setInputStream(inputStream); entity.setBody(baos.toString()); } }  }
GzipDecompressorProcessor extends ProcessorBase { @Override public void process(final WilmaHttpEntity entity) throws ApplicationException { if (isContentGzipEncoded(entity)) { ByteArrayOutputStream baos = decompressor.decompress(entity.getInputStream()); ByteArrayInputStream inputStream = new ByteArrayInputStream(baos.toByteArray()); entity.setInputStream(inputStream); entity.setBody(baos.toString()); } }  @Override void process(final WilmaHttpEntity entity); }
GzipDecompressorProcessor extends ProcessorBase { @Override public void process(final WilmaHttpEntity entity) throws ApplicationException { if (isContentGzipEncoded(entity)) { ByteArrayOutputStream baos = decompressor.decompress(entity.getInputStream()); ByteArrayInputStream inputStream = new ByteArrayInputStream(baos.toByteArray()); entity.setInputStream(inputStream); entity.setBody(baos.toString()); } }  @Override void process(final WilmaHttpEntity entity);  }