@Test(expected = ValueSetNotFoundException.class) public void testfindId() throws ValueSetNotFoundException, ConceptCodeNotFoundException { ConceptCode conceptCode = mock(ConceptCode.class); when(conceptCodeRepository.findOne(anyLong())).thenReturn(conceptCode); ConceptCodeDto conceptCodeDto = mock(ConceptCodeDto.class); when(valueSetMgmtHelper.createConceptCodeDtoFromEntity(conceptCode)) .thenReturn(conceptCodeDto); conceptCodeServiceImpl.findById((long) 1); }
@Override public ConceptCodeDto findById(Long id) throws ValueSetNotFoundException, ConceptCodeNotFoundException { logger.debug("Finding a ConceptCode with id: " + id); ConceptCode conceptCode = conceptCodeRepository.findOne(id); if (null == conceptCode) { throw new ConceptCodeNotFoundException( "Selected Code is not Available"); } ConceptCodeDto conceptCodeDto = valueSetMgmtHelper .createConceptCodeDtoFromEntity(conceptCode); conceptCodeDto.setValueSetMap(getAllValueSetsInMap()); conceptCodeDto .setValueSetIds(getAllValueSetIdsForConceptCode(conceptCode .getId())); return conceptCodeDto; }
ConceptCodeServiceImpl implements ConceptCodeService { @Override public ConceptCodeDto findById(Long id) throws ValueSetNotFoundException, ConceptCodeNotFoundException { logger.debug("Finding a ConceptCode with id: " + id); ConceptCode conceptCode = conceptCodeRepository.findOne(id); if (null == conceptCode) { throw new ConceptCodeNotFoundException( "Selected Code is not Available"); } ConceptCodeDto conceptCodeDto = valueSetMgmtHelper .createConceptCodeDtoFromEntity(conceptCode); conceptCodeDto.setValueSetMap(getAllValueSetsInMap()); conceptCodeDto .setValueSetIds(getAllValueSetIdsForConceptCode(conceptCode .getId())); return conceptCodeDto; } }
ConceptCodeServiceImpl implements ConceptCodeService { @Override public ConceptCodeDto findById(Long id) throws ValueSetNotFoundException, ConceptCodeNotFoundException { logger.debug("Finding a ConceptCode with id: " + id); ConceptCode conceptCode = conceptCodeRepository.findOne(id); if (null == conceptCode) { throw new ConceptCodeNotFoundException( "Selected Code is not Available"); } ConceptCodeDto conceptCodeDto = valueSetMgmtHelper .createConceptCodeDtoFromEntity(conceptCode); conceptCodeDto.setValueSetMap(getAllValueSetsInMap()); conceptCodeDto .setValueSetIds(getAllValueSetIdsForConceptCode(conceptCode .getId())); return conceptCodeDto; } ConceptCodeServiceImpl(int conceptCodePageSize,
			ConceptCodeRepository conceptCodeRepository,
			ValueSetRepository valueSetRepository,
			CodeSystemRepository codeSystemRepository,
			CodeSystemVersionRepository codeSystemVersionRepository,
			ConceptCodeValueSetRepository conceptCodeValueSetRepository,
			ValueSetMgmtHelper valueSetMgmtHelper); }
ConceptCodeServiceImpl implements ConceptCodeService { @Override public ConceptCodeDto findById(Long id) throws ValueSetNotFoundException, ConceptCodeNotFoundException { logger.debug("Finding a ConceptCode with id: " + id); ConceptCode conceptCode = conceptCodeRepository.findOne(id); if (null == conceptCode) { throw new ConceptCodeNotFoundException( "Selected Code is not Available"); } ConceptCodeDto conceptCodeDto = valueSetMgmtHelper .createConceptCodeDtoFromEntity(conceptCode); conceptCodeDto.setValueSetMap(getAllValueSetsInMap()); conceptCodeDto .setValueSetIds(getAllValueSetIdsForConceptCode(conceptCode .getId())); return conceptCodeDto; } ConceptCodeServiceImpl(int conceptCodePageSize,
			ConceptCodeRepository conceptCodeRepository,
			ValueSetRepository valueSetRepository,
			CodeSystemRepository codeSystemRepository,
			CodeSystemVersionRepository codeSystemVersionRepository,
			ConceptCodeValueSetRepository conceptCodeValueSetRepository,
			ValueSetMgmtHelper valueSetMgmtHelper); @Override @Transactional(rollbackFor = ConceptCodeNotFoundException.class) ConceptCodeDto delete(Long conceptCodeId); @Override ConceptCodeDto findById(Long id); @Override @Transactional(rollbackFor = ConceptCodeNotFoundException.class) ConceptCodeDto update(ConceptCodeDto updated); @Override List<ConceptCodeDto> findAll(); @Override Map<String, Object> findAll(int pageNumber); @Override Map<String, Object> findAllByCode(String searchTerm,
			String codeSystem, String codeSystemVersion, String valueSetName,
			int pageNumber); @Override Map<String, Object> findAllByName(String searchTerm,
			String codeSystem, String codeSystemVersion, String valueSetName,
			int pageNumber); @Override ConceptCodeVSCSDto create(); @Override @Transactional ConceptCodeDto create(ConceptCodeDto created); @Override @Transactional(rollbackFor = DataIntegrityViolationException.class) ConceptCodeDto conceptCodeBatchUpload(ConceptCodeDto conceptCodeDto,
			MultipartFile file, String codeSystemId, Long codeSystemVersionId,
			List<Long> valueSetIds); @Override List<ValueSet> findValueSetsByCodeSystem(String codeSystem,
			String codeSystemVersion); }
ConceptCodeServiceImpl implements ConceptCodeService { @Override public ConceptCodeDto findById(Long id) throws ValueSetNotFoundException, ConceptCodeNotFoundException { logger.debug("Finding a ConceptCode with id: " + id); ConceptCode conceptCode = conceptCodeRepository.findOne(id); if (null == conceptCode) { throw new ConceptCodeNotFoundException( "Selected Code is not Available"); } ConceptCodeDto conceptCodeDto = valueSetMgmtHelper .createConceptCodeDtoFromEntity(conceptCode); conceptCodeDto.setValueSetMap(getAllValueSetsInMap()); conceptCodeDto .setValueSetIds(getAllValueSetIdsForConceptCode(conceptCode .getId())); return conceptCodeDto; } ConceptCodeServiceImpl(int conceptCodePageSize,
			ConceptCodeRepository conceptCodeRepository,
			ValueSetRepository valueSetRepository,
			CodeSystemRepository codeSystemRepository,
			CodeSystemVersionRepository codeSystemVersionRepository,
			ConceptCodeValueSetRepository conceptCodeValueSetRepository,
			ValueSetMgmtHelper valueSetMgmtHelper); @Override @Transactional(rollbackFor = ConceptCodeNotFoundException.class) ConceptCodeDto delete(Long conceptCodeId); @Override ConceptCodeDto findById(Long id); @Override @Transactional(rollbackFor = ConceptCodeNotFoundException.class) ConceptCodeDto update(ConceptCodeDto updated); @Override List<ConceptCodeDto> findAll(); @Override Map<String, Object> findAll(int pageNumber); @Override Map<String, Object> findAllByCode(String searchTerm,
			String codeSystem, String codeSystemVersion, String valueSetName,
			int pageNumber); @Override Map<String, Object> findAllByName(String searchTerm,
			String codeSystem, String codeSystemVersion, String valueSetName,
			int pageNumber); @Override ConceptCodeVSCSDto create(); @Override @Transactional ConceptCodeDto create(ConceptCodeDto created); @Override @Transactional(rollbackFor = DataIntegrityViolationException.class) ConceptCodeDto conceptCodeBatchUpload(ConceptCodeDto conceptCodeDto,
			MultipartFile file, String codeSystemId, Long codeSystemVersionId,
			List<Long> valueSetIds); @Override List<ValueSet> findValueSetsByCodeSystem(String codeSystem,
			String codeSystemVersion); final int CONCEPT_CODE_PAGE_SIZE; }