@Test public void testDeleteCodeSystem() throws CodeSystemNotFoundException { CodeSystem deleted = mock(CodeSystem.class); when(codeSystemRepository.findOne(anyLong())).thenReturn(deleted); CodeSystemDto codeSystemDto = mock(CodeSystemDto.class); when(valueSetMgmtHelper.createCodeSystemDtoFromEntity(deleted)) .thenReturn(codeSystemDto); Assert.assertEquals(vst.delete((long) 1), codeSystemDto); }
@Override @Transactional(rollbackFor = CodeSystemNotFoundException.class) public CodeSystemDto delete(Long codeSystemId) throws CodeSystemNotFoundException { LOGGER.debug("Deleting CodeSystem with id: " + codeSystemId); CodeSystem deleted = codeSystemRepository.findOne(codeSystemId); if (deleted == null) { LOGGER.debug("No CodeSystem found with an id: " + codeSystemId); throw new CodeSystemNotFoundException(); } codeSystemRepository.delete(deleted); return valueSetMgmtHelper.createCodeSystemDtoFromEntity(deleted); }
CodeSystemServiceImpl implements CodeSystemService { @Override @Transactional(rollbackFor = CodeSystemNotFoundException.class) public CodeSystemDto delete(Long codeSystemId) throws CodeSystemNotFoundException { LOGGER.debug("Deleting CodeSystem with id: " + codeSystemId); CodeSystem deleted = codeSystemRepository.findOne(codeSystemId); if (deleted == null) { LOGGER.debug("No CodeSystem found with an id: " + codeSystemId); throw new CodeSystemNotFoundException(); } codeSystemRepository.delete(deleted); return valueSetMgmtHelper.createCodeSystemDtoFromEntity(deleted); } }
CodeSystemServiceImpl implements CodeSystemService { @Override @Transactional(rollbackFor = CodeSystemNotFoundException.class) public CodeSystemDto delete(Long codeSystemId) throws CodeSystemNotFoundException { LOGGER.debug("Deleting CodeSystem with id: " + codeSystemId); CodeSystem deleted = codeSystemRepository.findOne(codeSystemId); if (deleted == null) { LOGGER.debug("No CodeSystem found with an id: " + codeSystemId); throw new CodeSystemNotFoundException(); } codeSystemRepository.delete(deleted); return valueSetMgmtHelper.createCodeSystemDtoFromEntity(deleted); } CodeSystemServiceImpl(CodeSystemRepository codeSystemRepository,
			ValueSetMgmtHelper valueSetMgmtHelper); }
CodeSystemServiceImpl implements CodeSystemService { @Override @Transactional(rollbackFor = CodeSystemNotFoundException.class) public CodeSystemDto delete(Long codeSystemId) throws CodeSystemNotFoundException { LOGGER.debug("Deleting CodeSystem with id: " + codeSystemId); CodeSystem deleted = codeSystemRepository.findOne(codeSystemId); if (deleted == null) { LOGGER.debug("No CodeSystem found with an id: " + codeSystemId); throw new CodeSystemNotFoundException(); } codeSystemRepository.delete(deleted); return valueSetMgmtHelper.createCodeSystemDtoFromEntity(deleted); } 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 delete(Long codeSystemId) throws CodeSystemNotFoundException { LOGGER.debug("Deleting CodeSystem with id: " + codeSystemId); CodeSystem deleted = codeSystemRepository.findOne(codeSystemId); if (deleted == null) { LOGGER.debug("No CodeSystem found with an id: " + codeSystemId); throw new CodeSystemNotFoundException(); } codeSystemRepository.delete(deleted); return valueSetMgmtHelper.createCodeSystemDtoFromEntity(deleted); } 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);  }