### Question:
ResourceService { public List<ResourceDto> findResourceByCondition(ResourceDto resourceDto, QueryVO queryVO) { Specification<Resource> condition = (root, query, builder) -> { List<Predicate> predicates = new ArrayList<>(); if (StringUtils.isNotEmpty(resourceDto.getName())) { predicates.add(builder.like(root.get("name"), "%" + resourceDto.getName() + "%")); } Predicate[] ps = new Predicate[predicates.size()]; return query.where(builder.and(predicates.toArray(ps))).getRestriction(); }; List<Resource> result = resourceDao.findAll(condition); return resourceMapper.toDto(result); } @Autowired  ResourceService(ResourceDao resourceDao,
	                       RoleResourceDao roleResourceDao,
	                       ResourceMapper resourceMapper); List<ResourceDto> findResourceByCondition(ResourceDto resourceDto, QueryVO queryVO); ResourceDto findResourceById(String resId); Set<ResourceDto> findResourceByRoleIds(List<String> resId); void saveOrUpdate(ResourceDto resourceDto); void deleteByIds(List<String> resId);  }### Answer:
@Test public void findResourceByCondition() { QueryVO queryVO = new QueryVO(); List<ResourceDto> dictByCondition = resourceService.findResourceByCondition(new ResourceDto(), queryVO); Assert.assertTrue(dictByCondition.size() > 0); }