@Test public void processEnrichmentTagItem() { EnrichmentTagItem enrichmentTagItem = mock(EnrichmentTagItem.class); UploadEnrichmentTag uploadEnrichmentTag = mock(UploadEnrichmentTag.class); when(enrichmentTagItemConverter.convertEnrichmentTagItem(enrichmentTagItem)).thenReturn(uploadEnrichmentTag); enrichmentTagItemUploadProcessor.processEnrichmentTagItem(enrichmentTagItem); ArgumentCaptor<EnrichmentTagItem> enrichmentTagItemArg = ArgumentCaptor.forClass(EnrichmentTagItem.class); verify(commonValidator).validateEx(enrichmentTagItemArg.capture()); assertTrue(enrichmentTagItem == enrichmentTagItemArg.getValue()); ArgumentCaptor<UploadEnrichmentTag> uploadEnrichmentTagArg = ArgumentCaptor.forClass(UploadEnrichmentTag.class); verify(uploadEnrichmentTagRepository).saveAndFlush(uploadEnrichmentTagArg.capture()); assertTrue(uploadEnrichmentTag == uploadEnrichmentTagArg.getValue()); verify(entityManager).clear(); }
public void processEnrichmentTagItem(EnrichmentTagItem enrichmentTagItem) { commonValidator.validateEx(enrichmentTagItem); UploadEnrichmentTag uploadEnrichmentTag = enrichmentTagItemConverter.convertEnrichmentTagItem(enrichmentTagItem); uploadEnrichmentTagRepository.saveAndFlush(uploadEnrichmentTag); entityManager.clear(); }
EnrichmentTagItemUploadProcessor { public void processEnrichmentTagItem(EnrichmentTagItem enrichmentTagItem) { commonValidator.validateEx(enrichmentTagItem); UploadEnrichmentTag uploadEnrichmentTag = enrichmentTagItemConverter.convertEnrichmentTagItem(enrichmentTagItem); uploadEnrichmentTagRepository.saveAndFlush(uploadEnrichmentTag); entityManager.clear(); } }
EnrichmentTagItemUploadProcessor { public void processEnrichmentTagItem(EnrichmentTagItem enrichmentTagItem) { commonValidator.validateEx(enrichmentTagItem); UploadEnrichmentTag uploadEnrichmentTag = enrichmentTagItemConverter.convertEnrichmentTagItem(enrichmentTagItem); uploadEnrichmentTagRepository.saveAndFlush(uploadEnrichmentTag); entityManager.clear(); }  }
EnrichmentTagItemUploadProcessor { public void processEnrichmentTagItem(EnrichmentTagItem enrichmentTagItem) { commonValidator.validateEx(enrichmentTagItem); UploadEnrichmentTag uploadEnrichmentTag = enrichmentTagItemConverter.convertEnrichmentTagItem(enrichmentTagItem); uploadEnrichmentTagRepository.saveAndFlush(uploadEnrichmentTag); entityManager.clear(); }  void processEnrichmentTagItem(EnrichmentTagItem enrichmentTagItem); @Autowired void setEnrichmentTagItemConverter(EnrichmentTagItemConverter enrichmentTagItemConverter); @Autowired void setUploadEnrichmentTagRepository(UploadEnrichmentTagRepository uploadEnrichmentTagRepository); @Autowired void setCommonValidator(CommonValidator commonValidator); @Autowired void setEntityManager(EntityManager entityManager); }
EnrichmentTagItemUploadProcessor { public void processEnrichmentTagItem(EnrichmentTagItem enrichmentTagItem) { commonValidator.validateEx(enrichmentTagItem); UploadEnrichmentTag uploadEnrichmentTag = enrichmentTagItemConverter.convertEnrichmentTagItem(enrichmentTagItem); uploadEnrichmentTagRepository.saveAndFlush(uploadEnrichmentTag); entityManager.clear(); }  void processEnrichmentTagItem(EnrichmentTagItem enrichmentTagItem); @Autowired void setEnrichmentTagItemConverter(EnrichmentTagItemConverter enrichmentTagItemConverter); @Autowired void setUploadEnrichmentTagRepository(UploadEnrichmentTagRepository uploadEnrichmentTagRepository); @Autowired void setCommonValidator(CommonValidator commonValidator); @Autowired void setEntityManager(EntityManager entityManager);  }