@Test(expected = CodeSystemNotFoundException.class) public void testUpdateCodeSystem_throw_CodeSystemNotFoundException() throws CodeSystemNotFoundException { CodeSystemDto updated = mock(CodeSystemDto.class); when(codeSystemRepository.findOne(anyLong())).thenReturn(null); vst.update(updated); }
@Override @Transactional(rollbackFor = CodeSystemNotFoundException.class) public CodeSystemDto update(CodeSystemDto updated) throws CodeSystemNotFoundException { LOGGER.debug("Updating CodeSystem with information" + updated); CodeSystem codeSystem = codeSystemRepository.findOne(updated.getId()); if (codeSystem == null) { LOGGER.debug("No CodeSystem found with an id: " + updated.getId()); throw new CodeSystemNotFoundException(); } codeSystem.update(updated.getCodeSystemOId(), updated.getCode(), updated.getName(), updated.getDisplayName(), updated.getUserName()); return valueSetMgmtHelper.createCodeSystemDtoFromEntity(codeSystem); }
CodeSystemServiceImpl implements CodeSystemService { @Override @Transactional(rollbackFor = CodeSystemNotFoundException.class) public CodeSystemDto update(CodeSystemDto updated) throws CodeSystemNotFoundException { LOGGER.debug("Updating CodeSystem with information" + updated); CodeSystem codeSystem = codeSystemRepository.findOne(updated.getId()); if (codeSystem == null) { LOGGER.debug("No CodeSystem found with an id: " + updated.getId()); throw new CodeSystemNotFoundException(); } codeSystem.update(updated.getCodeSystemOId(), updated.getCode(), updated.getName(), updated.getDisplayName(), updated.getUserName()); return valueSetMgmtHelper.createCodeSystemDtoFromEntity(codeSystem); } }
CodeSystemServiceImpl implements CodeSystemService { @Override @Transactional(rollbackFor = CodeSystemNotFoundException.class) public CodeSystemDto update(CodeSystemDto updated) throws CodeSystemNotFoundException { LOGGER.debug("Updating CodeSystem with information" + updated); CodeSystem codeSystem = codeSystemRepository.findOne(updated.getId()); if (codeSystem == null) { LOGGER.debug("No CodeSystem found with an id: " + updated.getId()); throw new CodeSystemNotFoundException(); } codeSystem.update(updated.getCodeSystemOId(), updated.getCode(), updated.getName(), updated.getDisplayName(), updated.getUserName()); return valueSetMgmtHelper.createCodeSystemDtoFromEntity(codeSystem); } CodeSystemServiceImpl(CodeSystemRepository codeSystemRepository,
			ValueSetMgmtHelper valueSetMgmtHelper); }
CodeSystemServiceImpl implements CodeSystemService { @Override @Transactional(rollbackFor = CodeSystemNotFoundException.class) public CodeSystemDto update(CodeSystemDto updated) throws CodeSystemNotFoundException { LOGGER.debug("Updating CodeSystem with information" + updated); CodeSystem codeSystem = codeSystemRepository.findOne(updated.getId()); if (codeSystem == null) { LOGGER.debug("No CodeSystem found with an id: " + updated.getId()); throw new CodeSystemNotFoundException(); } codeSystem.update(updated.getCodeSystemOId(), updated.getCode(), updated.getName(), updated.getDisplayName(), updated.getUserName()); return valueSetMgmtHelper.createCodeSystemDtoFromEntity(codeSystem); } CodeSystemServiceImpl(CodeSystemRepository codeSystemRepository,
			ValueSetMgmtHelper valueSetMgmtHelper); @Override @Transactional CodeSystemDto create(CodeSystemDto created); @Override @Transactional(rollbackFor = CodeSystemNotFoundException.class) CodeSystemDto delete(Long codeSystemId); @Override List<CodeSystemDto> findAll(); @Override CodeSystemDto findById(Long id); @Override @Transactional(rollbackFor = CodeSystemNotFoundException.class) CodeSystemDto update(CodeSystemDto updated); }
CodeSystemServiceImpl implements CodeSystemService { @Override @Transactional(rollbackFor = CodeSystemNotFoundException.class) public CodeSystemDto update(CodeSystemDto updated) throws CodeSystemNotFoundException { LOGGER.debug("Updating CodeSystem with information" + updated); CodeSystem codeSystem = codeSystemRepository.findOne(updated.getId()); if (codeSystem == null) { LOGGER.debug("No CodeSystem found with an id: " + updated.getId()); throw new CodeSystemNotFoundException(); } codeSystem.update(updated.getCodeSystemOId(), updated.getCode(), updated.getName(), updated.getDisplayName(), updated.getUserName()); return valueSetMgmtHelper.createCodeSystemDtoFromEntity(codeSystem); } CodeSystemServiceImpl(CodeSystemRepository codeSystemRepository,
			ValueSetMgmtHelper valueSetMgmtHelper); @Override @Transactional CodeSystemDto create(CodeSystemDto created); @Override @Transactional(rollbackFor = CodeSystemNotFoundException.class) CodeSystemDto delete(Long codeSystemId); @Override List<CodeSystemDto> findAll(); @Override CodeSystemDto findById(Long id); @Override @Transactional(rollbackFor = CodeSystemNotFoundException.class) CodeSystemDto update(CodeSystemDto updated);  }