### Question:
UserService { public Page<UserDto> findByCondition(UserDto userDto, Pageable pageable) { Specification<User> condition = (root, query, builder) -> { List<Predicate> predicates = new ArrayList<>(); if (StringUtils.isNotEmpty(userDto.getUserName())) { predicates.add(builder.like(root.get("userName"), "%" + userDto.getUserName() + "%")); } if (userDto.getStatus() != null) { predicates.add(builder.equal(root.get("status"), userDto.getStatus())); } if (StringUtils.isNotEmpty(userDto.getId())) { predicates.add(builder.equal(root.get("id"), userDto.getId())); } if (StringUtils.isNotEmpty(userDto.getAccount())) { predicates.add(builder.like(root.get("account"), "%" + userDto.getAccount() + "%")); } if (StringUtils.isNotEmpty(userDto.getPhone())) { predicates.add(builder.like(root.get("phone"), "%" + userDto.getPhone() + "%")); } Predicate[] ps = new Predicate[predicates.size()]; return query.where(builder.and(predicates.toArray(ps))).getRestriction(); }; Page<UserDto> result = userDao.findAll(condition, pageable).map(userMapper::toDto); result.getContent().stream().map(this::assembleUserRoleData); return result; } UserService(UserDao userDao,
	                   UserMapper userMapper,
	                   BCryptPasswordEncoder bCryptPasswordEncoder,
	                   LoginLogServiceRpc loginLogServiceRpc,
	                   RoleDao roleDao,
	                   ResourceDao resourceDao,
	                   UserRoleDao userRoleDao,
	                   RoleMapper roleMapper,
	                   ResourceDao resourceDao1,
	                   ResourceMapper resourceMapper, JPAQueryFactory jpaQueryFactory); void registerUser(UserDto userDto); Page<UserDto> findByCondition(UserDto userDto, Pageable pageable); void deleteByIds(List<String> userIds); void updateByPrimaryKey(UserDto userDto); void changePassword(String userId, String oldPassword, String newOnePass); UserDto getUserPermission(String id); List<UserDto> findUsersOfRole(RoleDto roleDto); UserDto findById(String userId); UserDto findByCondition(UserDto userDto); void updateUserProfile(UserDto userDto);  }### Answer:
@Test public void findByCondition() { Page<UserDto> dictByCondition = userService.findByCondition(new UserDto(), null); Assert.assertTrue(dictByCondition.getTotalElements() > 0); }