@Test public void read() throws Exception { LawJournalEntry lawJournalEntry1 = new LawJournalEntry(2001, 24, 321, "Ustawa 1"); LawJournalEntry lawJournalEntry2 = new LawJournalEntry(2003, 27, 345, "Ustawa 2"); when(enrichmentTagLawJournalEntryFetcher.fetchTagLawJournalEntriesWihoutCorrespondingEntryInDb()) .thenReturn(Lists.newArrayList(lawJournalEntry1, lawJournalEntry2)); enrichmentTagLawJournalEntryReader.open(Mockito.mock(ExecutionContext.class)); LawJournalEntry retLawJournalEntry1 = enrichmentTagLawJournalEntryReader.read(); LawJournalEntry retLawJournalEntry2 = enrichmentTagLawJournalEntryReader.read(); LawJournalEntry retLawJournalEntry3 = enrichmentTagLawJournalEntryReader.read(); assertEquals(lawJournalEntry1, retLawJournalEntry1); assertEquals(lawJournalEntry2, retLawJournalEntry2); assertNull(retLawJournalEntry3); }
@Override public LawJournalEntry read() throws Exception, UnexpectedInputException, ParseException, NonTransientResourceException { return lawJournalEntries.poll(); }
EnrichmentTagLawJournalEntryReader implements ItemStreamReader<LawJournalEntry> { @Override public LawJournalEntry read() throws Exception, UnexpectedInputException, ParseException, NonTransientResourceException { return lawJournalEntries.poll(); } }
EnrichmentTagLawJournalEntryReader implements ItemStreamReader<LawJournalEntry> { @Override public LawJournalEntry read() throws Exception, UnexpectedInputException, ParseException, NonTransientResourceException { return lawJournalEntries.poll(); }  }
EnrichmentTagLawJournalEntryReader implements ItemStreamReader<LawJournalEntry> { @Override public LawJournalEntry read() throws Exception, UnexpectedInputException, ParseException, NonTransientResourceException { return lawJournalEntries.poll(); }  @Override void open(ExecutionContext executionContext); @Override LawJournalEntry read(); @Override void update(ExecutionContext executionContext); @Override void close(); @Autowired void setEnrichmentTagLawJournalEntryFetcher(
            EnrichmentTagLawJournalEntryFetcher enrichmentTagLawJournalEntryFetcher); }
EnrichmentTagLawJournalEntryReader implements ItemStreamReader<LawJournalEntry> { @Override public LawJournalEntry read() throws Exception, UnexpectedInputException, ParseException, NonTransientResourceException { return lawJournalEntries.poll(); }  @Override void open(ExecutionContext executionContext); @Override LawJournalEntry read(); @Override void update(ExecutionContext executionContext); @Override void close(); @Autowired void setEnrichmentTagLawJournalEntryFetcher(
            EnrichmentTagLawJournalEntryFetcher enrichmentTagLawJournalEntryFetcher);  }