@Test(expected=ValidationException.class) public void processEnrichmentTagItem_ValidationError() throws Exception { EnrichmentTagItem enrichmentTagItem = mock(EnrichmentTagItem.class); Mockito.doThrow(ValidationException.class).when(commonValidator).validateEx(enrichmentTagItem); enrichmentTagItemUploadProcessor.processEnrichmentTagItem(enrichmentTagItem); }
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);  }