@Test
public void testMultipleFilesWithContextSameFeed() throws IOException {

    init();
    final StroomZipRepository proxyRepository = proxyRepositoryManager.getActiveRepository();
    final StroomZipOutputStream stroomZipOutputStream1 = proxyRepository.getStroomZipOutputStream();
    StroomZipOutputStreamUtil.addSimpleEntry(stroomZipOutputStream1,
            new StroomZipEntry("req.header", "req", StroomZipFileType.Meta),
            "Feed:TEST\nGUID:Z1\n".getBytes(StreamUtil.DEFAULT_CHARSET));
    StroomZipOutputStreamUtil.addSimpleEntry(stroomZipOutputStream1,
            new StroomZipEntry("req.data", "req", StroomZipFileType.Data),
            "Test Data".getBytes(StreamUtil.DEFAULT_CHARSET));
    StroomZipOutputStreamUtil.addSimpleEntry(stroomZipOutputStream1,
            new StroomZipEntry("req.context", "req", StroomZipFileType.Context),
            "Test Context".getBytes(StreamUtil.DEFAULT_CHARSET));
    stroomZipOutputStream1.close();
    final StroomZipOutputStream stroomZipOutputStream2 = proxyRepository.getStroomZipOutputStream();
    StroomZipOutputStreamUtil.addSimpleEntry(stroomZipOutputStream2,
            new StroomZipEntry("req.header", "req", StroomZipFileType.Meta),
            "Feed:TEST\nGUID:Z2\n".getBytes(StreamUtil.DEFAULT_CHARSET));
    StroomZipOutputStreamUtil.addSimpleEntry(stroomZipOutputStream2,
            new StroomZipEntry("req.data", "req", StroomZipFileType.Data),
            "Test Data".getBytes(StreamUtil.DEFAULT_CHARSET));
    StroomZipOutputStreamUtil.addSimpleEntry(stroomZipOutputStream2,
            new StroomZipEntry("req.context", "req", StroomZipFileType.Context),
            "Test Context".getBytes(StreamUtil.DEFAULT_CHARSET));
    stroomZipOutputStream2.close();
    proxyRepositoryReader.doRunWork();
    Assert.assertEquals(1, mockRequestHandler.getHandleHeaderCount());
    Assert.assertEquals(1, mockRequestHandler.getHandleFooterCount());
    Assert.assertEquals(6, mockRequestHandler.getHandleEntryCount());
    Assert.assertEquals(0, mockRequestHandler.getHandleErrorCount());
    Assert.assertEquals(Arrays.asList("001.meta", "001.ctx", "001.dat", "002.meta", "002.ctx", "002.dat"),
            mockRequestHandler.getEntryNameList());
    proxyRepository.clean();
    final String sendHeader2 = new String(mockRequestHandler.getByteArray("002.meta"), StreamUtil.DEFAULT_CHARSET);
    Assert.assertTrue(sendHeader2.contains("Feed:TEST"));
    Assert.assertTrue(sendHeader2.contains("GUID:Z2"));
    Assert.assertEquals("Test Data",
            new String(mockRequestHandler.getByteArray("001.dat"), StreamUtil.DEFAULT_CHARSET));
    Assert.assertEquals("Test Data",
            new String(mockRequestHandler.getByteArray("002.dat"), StreamUtil.DEFAULT_CHARSET));
    Assert.assertFalse(isZipFile(proxyRepository, 1));
    Assert.assertFalse(isZipFile(proxyRepository, 2));
}