@Test public void testPurgeResetDeltas() throws Exception { Mockito.when(batchJobDAO.getDuplicateDetectionMode(jobId)).thenReturn(RecordHash.RECORD_HASH_MODE_RESET); Exchange exchange = new DefaultExchange(new DefaultCamelContext()); WorkNote workNote = new WorkNote(jobId, false); exchange.getIn().setBody(workNote); boolean isEligible = batchJobManager.isEligibleForDeltaPurge(exchange); Assert.assertTrue(isEligible); }
public boolean isEligibleForDeltaPurge(Exchange exchange) { WorkNote workNote = exchange.getIn().getBody(WorkNote.class); String jobId = workNote.getBatchJobId(); String deltaMode = batchJobDAO.getDuplicateDetectionMode(jobId); if(deltaMode != null && isDeltaPurgeMode(deltaMode)) { return true; } return false; }
BatchJobManager { public boolean isEligibleForDeltaPurge(Exchange exchange) { WorkNote workNote = exchange.getIn().getBody(WorkNote.class); String jobId = workNote.getBatchJobId(); String deltaMode = batchJobDAO.getDuplicateDetectionMode(jobId); if(deltaMode != null && isDeltaPurgeMode(deltaMode)) { return true; } return false; } }
BatchJobManager { public boolean isEligibleForDeltaPurge(Exchange exchange) { WorkNote workNote = exchange.getIn().getBody(WorkNote.class); String jobId = workNote.getBatchJobId(); String deltaMode = batchJobDAO.getDuplicateDetectionMode(jobId); if(deltaMode != null && isDeltaPurgeMode(deltaMode)) { return true; } return false; }  }
BatchJobManager { public boolean isEligibleForDeltaPurge(Exchange exchange) { WorkNote workNote = exchange.getIn().getBody(WorkNote.class); String jobId = workNote.getBatchJobId(); String deltaMode = batchJobDAO.getDuplicateDetectionMode(jobId); if(deltaMode != null && isDeltaPurgeMode(deltaMode)) { return true; } return false; }  void prepareTenantContext(Exchange exchange); boolean isDryRun(Exchange exchange); boolean hasErrors(Exchange exchange); boolean isEligibleForDeltaPurge(Exchange exchange); }
BatchJobManager { public boolean isEligibleForDeltaPurge(Exchange exchange) { WorkNote workNote = exchange.getIn().getBody(WorkNote.class); String jobId = workNote.getBatchJobId(); String deltaMode = batchJobDAO.getDuplicateDetectionMode(jobId); if(deltaMode != null && isDeltaPurgeMode(deltaMode)) { return true; } return false; }  void prepareTenantContext(Exchange exchange); boolean isDryRun(Exchange exchange); boolean hasErrors(Exchange exchange); boolean isEligibleForDeltaPurge(Exchange exchange);  }