@Test public void open() { List<Long> rJudgmentIds = Lists.newArrayList(12l, 123l, 45l); when(rawJudgmentRepository.findAllNotProcessedIds(RawSourceScJudgment.class)).thenReturn(rJudgmentIds); scjImportProcessReader.open(Mockito.mock(ExecutionContext.class)); List<Long> internalRJudgmentIds = Whitebox.getInternalState(scjImportProcessReader, "rJudgmentIds"); verify(rawJudgmentRepository).findAllNotProcessedIds(RawSourceScJudgment.class); verifyNoMoreInteractions(rawJudgmentRepository); assertEquals(rJudgmentIds, internalRJudgmentIds); }
@Override public void open(ExecutionContext executionContext) throws ItemStreamException { rJudgmentIds = new LinkedList<Long>(rawSourceJudgmentRepository.findAllNotProcessedIds(judgmentClass)); log.debug("Number of {} to process: {}", judgmentClass.getName(), rJudgmentIds.size()); }
JudgmentImportProcessReader implements ItemStreamReader<T> { @Override public void open(ExecutionContext executionContext) throws ItemStreamException { rJudgmentIds = new LinkedList<Long>(rawSourceJudgmentRepository.findAllNotProcessedIds(judgmentClass)); log.debug("Number of {} to process: {}", judgmentClass.getName(), rJudgmentIds.size()); } }
JudgmentImportProcessReader implements ItemStreamReader<T> { @Override public void open(ExecutionContext executionContext) throws ItemStreamException { rJudgmentIds = new LinkedList<Long>(rawSourceJudgmentRepository.findAllNotProcessedIds(judgmentClass)); log.debug("Number of {} to process: {}", judgmentClass.getName(), rJudgmentIds.size()); } JudgmentImportProcessReader(Class<T> judgmentClass); }
JudgmentImportProcessReader implements ItemStreamReader<T> { @Override public void open(ExecutionContext executionContext) throws ItemStreamException { rJudgmentIds = new LinkedList<Long>(rawSourceJudgmentRepository.findAllNotProcessedIds(judgmentClass)); log.debug("Number of {} to process: {}", judgmentClass.getName(), rJudgmentIds.size()); } JudgmentImportProcessReader(Class<T> judgmentClass); @Override T read(); @Override void open(ExecutionContext executionContext); @Override void update(ExecutionContext executionContext); @Override void close(); @Autowired void setRawSourceJudgmentRepository(RawSourceJudgmentRepository rawSourceJudgmentRepository); }
JudgmentImportProcessReader implements ItemStreamReader<T> { @Override public void open(ExecutionContext executionContext) throws ItemStreamException { rJudgmentIds = new LinkedList<Long>(rawSourceJudgmentRepository.findAllNotProcessedIds(judgmentClass)); log.debug("Number of {} to process: {}", judgmentClass.getName(), rJudgmentIds.size()); } JudgmentImportProcessReader(Class<T> judgmentClass); @Override T read(); @Override void open(ExecutionContext executionContext); @Override void update(ExecutionContext executionContext); @Override void close(); @Autowired void setRawSourceJudgmentRepository(RawSourceJudgmentRepository rawSourceJudgmentRepository);  }