@Test
    void testIOErrorWhileWriteGZIP() throws IOException, ServletException {
        request.addHeader("feed", "TEST-FEED");
        request.addHeader("periodStartTime", DateUtil.createNormalDateTimeString());
        request.addHeader("periodEndTime", DateUtil.createNormalDateTimeString());
        request.addHeader("compression", "GZIP");

        final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        try (final InputStream inputStream = new ByteArrayInputStream("SOME TEST DATA".getBytes())) {
            try (final GzipCompressorOutputStream gzipOutputStream = new GzipCompressorOutputStream(outputStream)) {
                StreamUtil.streamToStream(inputStream, gzipOutputStream);
            }
        }

        request.setInputStream(new CorruptInputStream(
                new ByteArrayInputStream(outputStream.toByteArray()), 10));

        assertThat(store.getStreamStoreCount())
                .isEqualTo(0);

        receiveDataServlet.doPost(request, response);

        assertThat(store.getStreamStoreCount())
                .isEqualTo(0);

        checkError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Expected IO Junit Error at byte ");
    }
The combination of mock and prod classes means this test needs its own
context.
stroom-app/src/test/java/stroom/receive/TestReceiveDataServlet.java