### Question:
QueryBuilderViewHandler extends ViewHandler { @Override protected ViewQuery createQuery(SlingHttpServletRequest slingRequest, Session session, String queryString) throws Exception { Map<String, String> map; if (GQLToQueryBuilderConverter.convertToQueryBuilder(slingRequest)) { map = this.convertToQueryBuilderParams(slingRequest, queryString); log.debug("Forced QueryBuilder Parameter Map: {}", map); } else { map = this.getQueryBuilderParams(slingRequest, queryString); log.debug("Converted QueryBuilder Parameter Map: {}", map); } final CloseableQuery query = queryBuilder.createQuery(PredicateGroup.create(map), session); return new QueryBuilderViewQuery(query); }    }### Answer:
@Test public void testActivate() throws Exception { QueryBuilderViewHandler viewHandler = slingContext.registerInjectActivateService(new QueryBuilderViewHandler()); MockSlingHttpServletRequest request = slingContext.request(); Map<String, Object> params = new HashMap<>(); params.put(ContentFinderConstants.CF_TYPE, "cq:Page"); request.setParameterMap(params); ViewQuery viewQuery = viewHandler.createQuery(request, slingContext.resourceResolver().adaptTo(Session.class), ""); viewQuery.execute(); assertNotNull("", viewQuery.execute()); }