@Test public void write() throws Exception { List<RawSourceCcJudgment> rJudgments = Lists.newArrayList(new RawSourceCcJudgment()); judgmentImportDownloadWriter.write(rJudgments); verify(rawSourceJudgmentRepository).save(Mockito.eq(rJudgments)); }
@Override public void write(List<? extends RawSourceJudgment> judgments) throws Exception { log.debug("persisting {} judgments...", judgments.size()); rawSourceJudgmentRepository.save(judgments); rawSourceJudgmentRepository.flush(); entityManager.clear(); }
JudgmentImportDownloadWriter implements ItemWriter<RawSourceJudgment> { @Override public void write(List<? extends RawSourceJudgment> judgments) throws Exception { log.debug("persisting {} judgments...", judgments.size()); rawSourceJudgmentRepository.save(judgments); rawSourceJudgmentRepository.flush(); entityManager.clear(); } }
JudgmentImportDownloadWriter implements ItemWriter<RawSourceJudgment> { @Override public void write(List<? extends RawSourceJudgment> judgments) throws Exception { log.debug("persisting {} judgments...", judgments.size()); rawSourceJudgmentRepository.save(judgments); rawSourceJudgmentRepository.flush(); entityManager.clear(); }  }
JudgmentImportDownloadWriter implements ItemWriter<RawSourceJudgment> { @Override public void write(List<? extends RawSourceJudgment> judgments) throws Exception { log.debug("persisting {} judgments...", judgments.size()); rawSourceJudgmentRepository.save(judgments); rawSourceJudgmentRepository.flush(); entityManager.clear(); }  @Override void write(List<? extends RawSourceJudgment> judgments); @Autowired void setRawSourceJudgmentRepository(RawSourceJudgmentRepository rawSourceJudgmentRepository); @Autowired void setEntityManager(EntityManager entityManager); }
JudgmentImportDownloadWriter implements ItemWriter<RawSourceJudgment> { @Override public void write(List<? extends RawSourceJudgment> judgments) throws Exception { log.debug("persisting {} judgments...", judgments.size()); rawSourceJudgmentRepository.save(judgments); rawSourceJudgmentRepository.flush(); entityManager.clear(); }  @Override void write(List<? extends RawSourceJudgment> judgments); @Autowired void setRawSourceJudgmentRepository(RawSourceJudgmentRepository rawSourceJudgmentRepository); @Autowired void setEntityManager(EntityManager entityManager);  }