### Question:
RoleService { public QueryResults<Role> findRuleByCondition(RoleDto roleDto, QueryVO queryVO) { QRole qRole = QRole.role; com.querydsl.core.types.Predicate predicate = null; OrderSpecifier<?> sortedColumn = QuerydslUtil.getSortedColumn(Order.DESC, qRole); if (StringUtils.isNotEmpty(roleDto.getRoleName())) { predicate = ExpressionUtils.and(predicate, qRole.roleName.like(roleDto.getRoleName())); } if (StringUtils.isNotEmpty(queryVO.getFieldSort())) { sortedColumn = QuerydslUtil.getSortedColumn(Order.DESC, qRole, queryVO.getFieldSort()); } QueryResults<Role> queryResults = jpaQueryFactory .selectFrom(qRole) .where(predicate) .offset(queryVO.getPageNum()) .limit(queryVO.getPageSize()) .orderBy(sortedColumn) .fetchResults(); return queryResults; } 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 findRuleByCondition() { QueryVO queryVO = new QueryVO(); QueryResults<Role> dictByCondition = roleService.findRuleByCondition(new RoleDto(), queryVO); Assert.assertTrue(dictByCondition.getTotal() > 0); }