@Test public void fetchOrCreateJudgmentResult_CREATE() { JudgmentResult retJudgmentResult = judgmentResultCreator.fetchOrCreateJudgmentResult(CourtType.SUPREME, "text"); assertEquals(new JudgmentResult(CourtType.SUPREME, "text"), retJudgmentResult); verify(judgmentResultRepository).findOneByCourtTypeAndTextIgnoreCase(CourtType.SUPREME, "text"); verify(judgmentResultRepository).save(new JudgmentResult(CourtType.SUPREME, "text")); verify(judgmentResultRepository).flush(); verifyNoMoreInteractions(judgmentResultRepository); }
public JudgmentResult fetchOrCreateJudgmentResult(CourtType courtType, String text) { JudgmentResult judgmentResult = judgmentResultRepository.findOneByCourtTypeAndTextIgnoreCase(courtType, text); if (judgmentResult == null) { judgmentResult = new JudgmentResult(courtType, text); judgmentResultRepository.save(judgmentResult); judgmentResultRepository.flush(); } return judgmentResult; }
JudgmentResultCreator { public JudgmentResult fetchOrCreateJudgmentResult(CourtType courtType, String text) { JudgmentResult judgmentResult = judgmentResultRepository.findOneByCourtTypeAndTextIgnoreCase(courtType, text); if (judgmentResult == null) { judgmentResult = new JudgmentResult(courtType, text); judgmentResultRepository.save(judgmentResult); judgmentResultRepository.flush(); } return judgmentResult; } }
JudgmentResultCreator { public JudgmentResult fetchOrCreateJudgmentResult(CourtType courtType, String text) { JudgmentResult judgmentResult = judgmentResultRepository.findOneByCourtTypeAndTextIgnoreCase(courtType, text); if (judgmentResult == null) { judgmentResult = new JudgmentResult(courtType, text); judgmentResultRepository.save(judgmentResult); judgmentResultRepository.flush(); } return judgmentResult; }  }
JudgmentResultCreator { public JudgmentResult fetchOrCreateJudgmentResult(CourtType courtType, String text) { JudgmentResult judgmentResult = judgmentResultRepository.findOneByCourtTypeAndTextIgnoreCase(courtType, text); if (judgmentResult == null) { judgmentResult = new JudgmentResult(courtType, text); judgmentResultRepository.save(judgmentResult); judgmentResultRepository.flush(); } return judgmentResult; }  JudgmentResult fetchOrCreateJudgmentResult(CourtType courtType, String text); @Autowired void setJudgmentResultRepository(JudgmentResultRepository judgmentResultRepository); }
JudgmentResultCreator { public JudgmentResult fetchOrCreateJudgmentResult(CourtType courtType, String text) { JudgmentResult judgmentResult = judgmentResultRepository.findOneByCourtTypeAndTextIgnoreCase(courtType, text); if (judgmentResult == null) { judgmentResult = new JudgmentResult(courtType, text); judgmentResultRepository.save(judgmentResult); judgmentResultRepository.flush(); } return judgmentResult; }  JudgmentResult fetchOrCreateJudgmentResult(CourtType courtType, String text); @Autowired void setJudgmentResultRepository(JudgmentResultRepository judgmentResultRepository);  }