@Test
@StroomExpectedException(exception = {IOException.class, ZipException.class})

public void testSimpleOneFileWithBadZip() throws IOException {
    init();
    final StroomZipRepository proxyRepository = proxyRepositoryManager.getActiveRepository();
    final StroomZipOutputStreamImpl stroomZipOutputStream = (StroomZipOutputStreamImpl) proxyRepository.getStroomZipOutputStream();
    StroomZipOutputStreamUtil.addSimpleEntry(stroomZipOutputStream, StroomZipFile.SINGLE_META_ENTRY,
            "Feed:TEST\nGUID:Z1\n".getBytes(StreamUtil.DEFAULT_CHARSET));
    StroomZipOutputStreamUtil.addSimpleEntry(stroomZipOutputStream, StroomZipFile.SINGLE_DATA_ENTRY,
            "Test Data".getBytes(StreamUtil.DEFAULT_CHARSET));
    stroomZipOutputStream.close();
    final Path zipFile = stroomZipOutputStream.getFile();
    Files.delete(zipFile);
    OutputStream testStream = null;
    try {
        testStream = Files.newOutputStream(zipFile);
        testStream.write("not a zip file".getBytes(StreamUtil.DEFAULT_CHARSET));
    } finally {
        CloseableUtil.close(testStream);
    }
    proxyRepositoryReader.doRunWork();
    // As the zip is corrupt we can't even read the header
    Assert.assertEquals(0, mockRequestHandler.getHandleHeaderCount());
    Assert.assertEquals(0, mockRequestHandler.getHandleFooterCount());
    Assert.assertEquals(0, mockRequestHandler.getHandleEntryCount());
    Assert.assertEquals(0, mockRequestHandler.getHandleErrorCount());
    proxyRepository.clean();
    Assert.assertTrue("Expecting bad file", isBadFile(proxyRepository, 1));
}