### Question:
CcjImportDownloadProcessor implements ItemProcessor<SourceCcJudgmentTextData, RawSourceCcJudgment> { @Override public RawSourceCcJudgment process(SourceCcJudgmentTextData ccjTextData) throws Exception { RawSourceCcJudgment rawSourceCcJudgment = sourceCcjTextDataConverter.convert(ccjTextData); if (rawSourceCcJudgmentRepository.findOneBySourceIdAndDataMd5(rawSourceCcJudgment.getSourceId(), rawSourceCcJudgment.getDataMd5()) != null) { log.debug("omitting, same judgment has been found in raw_source_cc_judgment: sourceId: {}, dataMd5: {}", rawSourceCcJudgment.getSourceId(), rawSourceCcJudgment.getDataMd5()); return null; } return rawSourceCcJudgment; }  @Override RawSourceCcJudgment process(SourceCcJudgmentTextData ccjTextData); @Autowired void setSourceCcjTextDataConverter(SourceCcjTextDataConverter sourceCcjTextDataConverter); @Autowired void setRawSourceCcJudgmentRepository(RawSourceCcJudgmentRepository rawSourceCcJudgmentRepository);  }### Answer:
@Test public void process_FoundSame() throws Exception { when(sourceCcjTextDataConverter.convert(Mockito.eq(ccjTextData))).thenReturn(rJudgment); Mockito.when(rawSourceCcJudgmentRepository.findOneBySourceIdAndDataMd5(rJudgment.getSourceId(), rJudgment.getDataMd5())).thenReturn(mock(RawSourceCcJudgment.class)); RawSourceCcJudgment rJudgment = ccjImportDownloadProcessor.process(ccjTextData); assertNull(rJudgment); }
@Test public void process_NotFoundSame() throws Exception { when(sourceCcjTextDataConverter.convert(Mockito.eq(ccjTextData))).thenReturn(rJudgment); Mockito.when(rawSourceCcJudgmentRepository.findOneBySourceIdAndDataMd5(rJudgment.getSourceId(), rJudgment.getDataMd5())).thenReturn(null); RawSourceCcJudgment returnedJudgment = ccjImportDownloadProcessor.process(ccjTextData); assertEquals(returnedJudgment, rJudgment); }