@Test public void fetchOrCreateMeansOfAppeal_CREATE() { MeansOfAppeal retMeansOfAppeal = meansOfAppealCreator.fetchOrCreateMeansOfAppeal(CourtType.SUPREME, "text"); assertEquals(new MeansOfAppeal(CourtType.SUPREME, "text"), retMeansOfAppeal); verify(meansOfAppealRepository).findOneByCourtTypeAndNameIgnoreCase(CourtType.SUPREME, "text"); verify(meansOfAppealRepository).save(new MeansOfAppeal(CourtType.SUPREME, "text")); verify(meansOfAppealRepository).flush(); verifyNoMoreInteractions(meansOfAppealRepository); }
public MeansOfAppeal fetchOrCreateMeansOfAppeal(CourtType courtType, String name) { MeansOfAppeal meansOfAppeal = meansOfAppealRepository.findOneByCourtTypeAndNameIgnoreCase(courtType, name); if (meansOfAppeal == null) { meansOfAppeal = new MeansOfAppeal(courtType, name); meansOfAppealRepository.save(meansOfAppeal); meansOfAppealRepository.flush(); } return meansOfAppeal; }
JudgmentMeansOfAppealCreator { public MeansOfAppeal fetchOrCreateMeansOfAppeal(CourtType courtType, String name) { MeansOfAppeal meansOfAppeal = meansOfAppealRepository.findOneByCourtTypeAndNameIgnoreCase(courtType, name); if (meansOfAppeal == null) { meansOfAppeal = new MeansOfAppeal(courtType, name); meansOfAppealRepository.save(meansOfAppeal); meansOfAppealRepository.flush(); } return meansOfAppeal; } }
JudgmentMeansOfAppealCreator { public MeansOfAppeal fetchOrCreateMeansOfAppeal(CourtType courtType, String name) { MeansOfAppeal meansOfAppeal = meansOfAppealRepository.findOneByCourtTypeAndNameIgnoreCase(courtType, name); if (meansOfAppeal == null) { meansOfAppeal = new MeansOfAppeal(courtType, name); meansOfAppealRepository.save(meansOfAppeal); meansOfAppealRepository.flush(); } return meansOfAppeal; }  }
JudgmentMeansOfAppealCreator { public MeansOfAppeal fetchOrCreateMeansOfAppeal(CourtType courtType, String name) { MeansOfAppeal meansOfAppeal = meansOfAppealRepository.findOneByCourtTypeAndNameIgnoreCase(courtType, name); if (meansOfAppeal == null) { meansOfAppeal = new MeansOfAppeal(courtType, name); meansOfAppealRepository.save(meansOfAppeal); meansOfAppealRepository.flush(); } return meansOfAppeal; }  MeansOfAppeal fetchOrCreateMeansOfAppeal(CourtType courtType, String name); @Autowired void setMeansOfAppealRepository(MeansOfAppealRepository meansOfAppealRepository); }
JudgmentMeansOfAppealCreator { public MeansOfAppeal fetchOrCreateMeansOfAppeal(CourtType courtType, String name) { MeansOfAppeal meansOfAppeal = meansOfAppealRepository.findOneByCourtTypeAndNameIgnoreCase(courtType, name); if (meansOfAppeal == null) { meansOfAppeal = new MeansOfAppeal(courtType, name); meansOfAppealRepository.save(meansOfAppeal); meansOfAppealRepository.flush(); } return meansOfAppeal; }  MeansOfAppeal fetchOrCreateMeansOfAppeal(CourtType courtType, String name); @Autowired void setMeansOfAppealRepository(MeansOfAppealRepository meansOfAppealRepository);  }