### Question:
OptLogService { public Page<OptLogDto> findOptLogByCondition(OptLogDto optLogDto, Pageable pageable) { Specification<OptLog> condition = (root, query, builder) -> { List<javax.persistence.criteria.Predicate> predicates = new ArrayList<>(); if (StringUtils.isNotEmpty(optLogDto.getClientIp())) { predicates.add(builder.like(root.get("clientIp"), "%" + optLogDto.getClientIp())); } return query.where(predicates.toArray(new javax.persistence.criteria.Predicate[0])).getRestriction(); }; Page<OptLogDto> queryResults = optLogDao.findAll(condition, pageable) .map(optLogMapper::toDto); queryResults.getContent().forEach( optLogList -> { UserDto userInfo = userServiceRpc.getUserInfo( new UserDto(optLogList.getUserId())) .getData(); if (userInfo.getId().equals(optLogList.getUserId())) { optLogList.setUserName(userInfo.getUserName()); } } ); return queryResults; } OptLogService(OptLogDao optLogDao,
	                     OptLogMapper optLogMapper,
	                     UserServiceRpc userServiceRpc); Page<OptLogDto> findOptLogByCondition(OptLogDto optLogDto, Pageable pageable); OptLogDto findById(String id); void insertOptLog(OptLogDto optLogDto); void deleteBatch(List<String> resId);  }### Answer:
@Test public void findOptLogByCondition() { QueryVO queryVO = new QueryVO(); Page<OptLogDto> dictByCondition = optLogService.findOptLogByCondition(new OptLogDto(), null); Assert.assertTrue(dictByCondition.getTotalElements() > 0); }