ValueSetCategoryServiceImpl implements ValueSetCategoryService { @Override public ValueSetCategoryDto findById(Long id) { logger.debug("Finding a ValueSetCategory with id: " + id); ValueSetCategory valueSetCategory = valueSetCategoryRepository .findOne(id); return valueSetMgmtHelper.createValuesetCategoryDtoFromEntity( valueSetCategory, consentRepository); } ValueSetCategoryServiceImpl(
			ValueSetCategoryRepository valueSetCategoryRepository,
			ConsentRepository consentRepository,
			ValueSetMgmtHelper valueSetMgmtHelper); @Override @Transactional ValueSetCategoryDto create(ValueSetCategoryDto created); @Override @Transactional(rollbackFor = ValueSetCategoryNotFoundException.class) ValueSetCategoryDto delete(Long valueSetCategoryId); @Override List<ValueSetCategoryDto> findAll(); @Override ValueSetCategoryDto findById(Long id); @Override @Transactional(rollbackFor = ValueSetCategoryNotFoundException.class) ValueSetCategoryDto update(ValueSetCategoryDto updated); @Override List<AddConsentFieldsDto> findAllValueSetCategoriesAddConsentFieldsDto();  }
@Test public void testfindId() { ValueSetCategory valueSetCategory = mock(ValueSetCategory.class); when(valueSetCategoryRepository.findOne(anyLong())).thenReturn( valueSetCategory); when( consentRepositoryMock .findAllByDoNotShareSensitivityPolicyCodesValueSetCategory(valueSetCategory)) .thenReturn(null); ValueSetCategoryDto valueSetCategoryDto = mock(ValueSetCategoryDto.class); when( valueSetMgmtHelper.createValuesetCategoryDtoFromEntity( valueSetCategory, consentRepositoryMock)).thenReturn( valueSetCategoryDto); assertEquals(vst.findById((long) 1), valueSetCategoryDto); }