@Test public void findOneAndEnrich_NotFound() { when(judgmentRepository.findOneAndInitialize(Mockito.anyLong())).thenReturn(null); assertNull(judgmentEnrichmentService.findOneAndEnrich(1)); }
public <T extends Judgment> T findOneAndEnrich(long judgmentId) { T judgment = judgmentRepository.findOneAndInitialize(judgmentId); if (judgment == null) { return null; } entityManager.detach(judgment); enrich(judgment); return judgment; }
JudgmentEnrichmentService { public <T extends Judgment> T findOneAndEnrich(long judgmentId) { T judgment = judgmentRepository.findOneAndInitialize(judgmentId); if (judgment == null) { return null; } entityManager.detach(judgment); enrich(judgment); return judgment; } }
JudgmentEnrichmentService { public <T extends Judgment> T findOneAndEnrich(long judgmentId) { T judgment = judgmentRepository.findOneAndInitialize(judgmentId); if (judgment == null) { return null; } entityManager.detach(judgment); enrich(judgment); return judgment; }  }
JudgmentEnrichmentService { public <T extends Judgment> T findOneAndEnrich(long judgmentId) { T judgment = judgmentRepository.findOneAndInitialize(judgmentId); if (judgment == null) { return null; } entityManager.detach(judgment); enrich(judgment); return judgment; }  T findOneAndEnrich(long judgmentId); void unenrichAndSave(Judgment judgment); void enrich(T judgment); void enrich(T judgment, List<EnrichmentTag> enrichmentTags); void enrich(T judgment, EnrichmentTag enrichmentTag); @Autowired void setJudgmentRepository(JudgmentRepository judgmentRepository); @Autowired void setEnrichmentTagRepository(EnrichmentTagRepository enrichmentTagRepository); @Autowired void setEnrichmentTagApplierManager(EnrichmentTagApplierManager enrichmentTagApplierManager); @Autowired void setEntityManager(EntityManager entityManager); }
JudgmentEnrichmentService { public <T extends Judgment> T findOneAndEnrich(long judgmentId) { T judgment = judgmentRepository.findOneAndInitialize(judgmentId); if (judgment == null) { return null; } entityManager.detach(judgment); enrich(judgment); return judgment; }  T findOneAndEnrich(long judgmentId); void unenrichAndSave(Judgment judgment); void enrich(T judgment); void enrich(T judgment, List<EnrichmentTag> enrichmentTags); void enrich(T judgment, EnrichmentTag enrichmentTag); @Autowired void setJudgmentRepository(JudgmentRepository judgmentRepository); @Autowired void setEnrichmentTagRepository(EnrichmentTagRepository enrichmentTagRepository); @Autowired void setEnrichmentTagApplierManager(EnrichmentTagApplierManager enrichmentTagApplierManager); @Autowired void setEntityManager(EntityManager entityManager);  }