CodeSystemServiceImpl implements CodeSystemService { @Override public List<CodeSystemDto> findAll() { LOGGER.debug("Finding all codeSystems"); List<CodeSystem> codeSystems = codeSystemRepository.findAll(); return valueSetMgmtHelper.convertCodeSystemEntitiesToDtos(codeSystems); } 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);  }
@Test public void testfindAll() { List<CodeSystem> codeSystems = mock(List.class); when(codeSystemRepository.findAll()).thenReturn(codeSystems); List<CodeSystemDto> codeSystemDtos = new ArrayList(); CodeSystemDto codeSystemDto = mock(CodeSystemDto.class); codeSystemDtos.add(codeSystemDto); when(valueSetMgmtHelper.convertCodeSystemEntitiesToDtos(codeSystems)) .thenReturn(codeSystemDtos); assertEquals(vst.findAll(), codeSystemDtos); }