@Test public void testHappyZipFileProcessor() throws Exception { Exchange preObject = new DefaultExchange(new DefaultCamelContext()); String batchJobId = NewBatchJob.createId("ValidZip.zip"); Mockito.when(workNote.getBatchJobId()).thenReturn(batchJobId); preObject.getIn().setBody(workNote); Mockito.when(mockedBatchJobDAO.findBatchJobById(Matchers.eq(batchJobId))).thenReturn(mockedJob); File zipFile = IngestionTest.getFile("zip/ValidZip.zip"); ResourceEntry entry = new ResourceEntry(); entry.setResourceName(zipFile.getAbsolutePath()); Mockito.when(mockedJob.getZipResourceEntry()).thenReturn(entry); createResourceEntryAndAddToJob(zipFile, mockedJob); mockedJob.setSourceId("zip"); preObject.getIn().setHeader("BatchJobId", batchJobId); zipProc.process(preObject); Assert.assertNotNull(preObject.getIn().getBody()); }
@Override public void process(Exchange exchange) throws Exception { WorkNote workNote = exchange.getIn().getBody(WorkNote.class); String batchJobId = workNote.getBatchJobId(); if (batchJobId == null) { handleNoBatchJobIdInExchange(exchange); } else { processZipFile(exchange, batchJobId); } }
ZipFileProcessor implements Processor { @Override public void process(Exchange exchange) throws Exception { WorkNote workNote = exchange.getIn().getBody(WorkNote.class); String batchJobId = workNote.getBatchJobId(); if (batchJobId == null) { handleNoBatchJobIdInExchange(exchange); } else { processZipFile(exchange, batchJobId); } } }
ZipFileProcessor implements Processor { @Override public void process(Exchange exchange) throws Exception { WorkNote workNote = exchange.getIn().getBody(WorkNote.class); String batchJobId = workNote.getBatchJobId(); if (batchJobId == null) { handleNoBatchJobIdInExchange(exchange); } else { processZipFile(exchange, batchJobId); } }  }
ZipFileProcessor implements Processor { @Override public void process(Exchange exchange) throws Exception { WorkNote workNote = exchange.getIn().getBody(WorkNote.class); String batchJobId = workNote.getBatchJobId(); if (batchJobId == null) { handleNoBatchJobIdInExchange(exchange); } else { processZipFile(exchange, batchJobId); } }  @Override void process(Exchange exchange); ZipFileHandler getHandler(); void setHandler(ZipFileHandler handler); }
ZipFileProcessor implements Processor { @Override public void process(Exchange exchange) throws Exception { WorkNote workNote = exchange.getIn().getBody(WorkNote.class); String batchJobId = workNote.getBatchJobId(); if (batchJobId == null) { handleNoBatchJobIdInExchange(exchange); } else { processZipFile(exchange, batchJobId); } }  @Override void process(Exchange exchange); ZipFileHandler getHandler(); void setHandler(ZipFileHandler handler); static final BatchJobStageType BATCH_JOB_STAGE; }