### Question:
RoleService { public void saveOrUpdate(RoleDto roleDto) { if (StringUtils.isNotBlank(roleDto.getId())) { Role sourceRole = roleDao.findById(roleDto.getId()).orElseThrow(ResourceNotFoundException::new); BeanUtil.copyProperties(sourceRole, roleDto); } roleDao.save(roleMapper.toEntity(roleDto)); List<RoleResource> roleResources = roleDto.getResources().stream() .map(role -> new RoleResource(roleDto.getId(), role.getId())) .collect(Collectors.toList()); roleResourceDao.deleteByRoleIdIn(Collections.singletonList(roleDto.getId())); roleResourceDao.saveAll(roleResources); } RoleService(RoleDao roleDao,
	                   RoleResourceDao roleResourceDao,
	                   UserRoleDao userRoleDao,
	                   RoleMapper roleMapper,
	                   JPAQueryFactory jpaQueryFactory, ResourceDao resourceDao, ResourceMapper resourceMapper); QueryResults<Role> findRuleByCondition(RoleDto roleDto, QueryVO queryVO); List<RoleDto> getUseRoles(String id); RoleDto findRoleById(String roleId); void saveOrUpdate(RoleDto roleDto); void deleteByIds(List<String> roleId);  }### Answer:
@Test public void saveOrUpdate() { RoleDto role = new RoleDto(); role.setRoleName("bar"); role.setCode("bar"); roleService.saveOrUpdate(role); }