CodeSystemServiceImpl implements CodeSystemService { @Override @Transactional public CodeSystemDto create(CodeSystemDto created) { LOGGER.debug("Creating a new CodeSystem with information: " + created); String displayName = (created.getDisplayName() != null) ? created .getDisplayName() : ""; CodeSystem codeSystem = CodeSystem .getBuilder(created.getCodeSystemOId(), created.getCode(), created.getName(), created.getUserName()) .displayName(displayName).build(); codeSystem = codeSystemRepository.save(codeSystem); 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);  }
@Test public void testCreateCodeSystem() { CodeSystemDto created = mock(CodeSystemDto.class); when(created.getDisplayName()).thenReturn("displayName"); CodeSystem codeSystem = mock(CodeSystem.class); when(codeSystemRepository.save(any(CodeSystem.class))).thenReturn( codeSystem); when(valueSetMgmtHelper.createCodeSystemDtoFromEntity(codeSystem)) .thenReturn(created); Assert.assertEquals(vst.create(created), created); }