@Test(expected = ValueSetCategoryNotFoundException.class) public void testUpdateValueSetCategory_throw_ValueSetCategoryNotFoundException() throws ValueSetCategoryNotFoundException { ValueSetCategoryDto updated = mock(ValueSetCategoryDto.class); when(valueSetCategoryRepository.findOne(anyLong())).thenReturn(null); vst.update(updated); }
@Override @Transactional(rollbackFor = ValueSetCategoryNotFoundException.class) public ValueSetCategoryDto update(ValueSetCategoryDto updated) throws ValueSetCategoryNotFoundException { logger.debug("Updating ValueSetCategory with information" + updated); ValueSetCategory valueSetCategory = valueSetCategoryRepository .findOne(updated.getId()); if (valueSetCategory == null) { logger.debug("No ValueSetCategory found with an id: " + updated.getId()); throw new ValueSetCategoryNotFoundException(); } valueSetCategory.update(updated.getCode(), updated.getName(), updated.getDescription(), updated.getUserName()); return valueSetMgmtHelper.createValuesetCategoryDtoFromEntity( valueSetCategory, consentRepository); }
ValueSetCategoryServiceImpl implements ValueSetCategoryService { @Override @Transactional(rollbackFor = ValueSetCategoryNotFoundException.class) public ValueSetCategoryDto update(ValueSetCategoryDto updated) throws ValueSetCategoryNotFoundException { logger.debug("Updating ValueSetCategory with information" + updated); ValueSetCategory valueSetCategory = valueSetCategoryRepository .findOne(updated.getId()); if (valueSetCategory == null) { logger.debug("No ValueSetCategory found with an id: " + updated.getId()); throw new ValueSetCategoryNotFoundException(); } valueSetCategory.update(updated.getCode(), updated.getName(), updated.getDescription(), updated.getUserName()); return valueSetMgmtHelper.createValuesetCategoryDtoFromEntity( valueSetCategory, consentRepository); } }
ValueSetCategoryServiceImpl implements ValueSetCategoryService { @Override @Transactional(rollbackFor = ValueSetCategoryNotFoundException.class) public ValueSetCategoryDto update(ValueSetCategoryDto updated) throws ValueSetCategoryNotFoundException { logger.debug("Updating ValueSetCategory with information" + updated); ValueSetCategory valueSetCategory = valueSetCategoryRepository .findOne(updated.getId()); if (valueSetCategory == null) { logger.debug("No ValueSetCategory found with an id: " + updated.getId()); throw new ValueSetCategoryNotFoundException(); } valueSetCategory.update(updated.getCode(), updated.getName(), updated.getDescription(), updated.getUserName()); return valueSetMgmtHelper.createValuesetCategoryDtoFromEntity( valueSetCategory, consentRepository); } ValueSetCategoryServiceImpl(
			ValueSetCategoryRepository valueSetCategoryRepository,
			ConsentRepository consentRepository,
			ValueSetMgmtHelper valueSetMgmtHelper); }
ValueSetCategoryServiceImpl implements ValueSetCategoryService { @Override @Transactional(rollbackFor = ValueSetCategoryNotFoundException.class) public ValueSetCategoryDto update(ValueSetCategoryDto updated) throws ValueSetCategoryNotFoundException { logger.debug("Updating ValueSetCategory with information" + updated); ValueSetCategory valueSetCategory = valueSetCategoryRepository .findOne(updated.getId()); if (valueSetCategory == null) { logger.debug("No ValueSetCategory found with an id: " + updated.getId()); throw new ValueSetCategoryNotFoundException(); } valueSetCategory.update(updated.getCode(), updated.getName(), updated.getDescription(), updated.getUserName()); return valueSetMgmtHelper.createValuesetCategoryDtoFromEntity( valueSetCategory, consentRepository); } ValueSetCategoryServiceImpl(
			ValueSetCategoryRepository valueSetCategoryRepository,
			ConsentRepository consentRepository,
			ValueSetMgmtHelper valueSetMgmtHelper); @Override @Transactional ValueSetCategoryDto create(ValueSetCategoryDto created); @Override @Transactional(rollbackFor = ValueSetCategoryNotFoundException.class) ValueSetCategoryDto delete(Long valueSetCategoryId); @Override List<ValueSetCategoryDto> findAll(); @Override ValueSetCategoryDto findById(Long id); @Override @Transactional(rollbackFor = ValueSetCategoryNotFoundException.class) ValueSetCategoryDto update(ValueSetCategoryDto updated); @Override List<AddConsentFieldsDto> findAllValueSetCategoriesAddConsentFieldsDto(); }
ValueSetCategoryServiceImpl implements ValueSetCategoryService { @Override @Transactional(rollbackFor = ValueSetCategoryNotFoundException.class) public ValueSetCategoryDto update(ValueSetCategoryDto updated) throws ValueSetCategoryNotFoundException { logger.debug("Updating ValueSetCategory with information" + updated); ValueSetCategory valueSetCategory = valueSetCategoryRepository .findOne(updated.getId()); if (valueSetCategory == null) { logger.debug("No ValueSetCategory found with an id: " + updated.getId()); throw new ValueSetCategoryNotFoundException(); } valueSetCategory.update(updated.getCode(), updated.getName(), updated.getDescription(), updated.getUserName()); return valueSetMgmtHelper.createValuesetCategoryDtoFromEntity( valueSetCategory, consentRepository); } ValueSetCategoryServiceImpl(
			ValueSetCategoryRepository valueSetCategoryRepository,
			ConsentRepository consentRepository,
			ValueSetMgmtHelper valueSetMgmtHelper); @Override @Transactional ValueSetCategoryDto create(ValueSetCategoryDto created); @Override @Transactional(rollbackFor = ValueSetCategoryNotFoundException.class) ValueSetCategoryDto delete(Long valueSetCategoryId); @Override List<ValueSetCategoryDto> findAll(); @Override ValueSetCategoryDto findById(Long id); @Override @Transactional(rollbackFor = ValueSetCategoryNotFoundException.class) ValueSetCategoryDto update(ValueSetCategoryDto updated); @Override List<AddConsentFieldsDto> findAllValueSetCategoriesAddConsentFieldsDto();  }