@Test public void testGroupActionMultipleFieldsNoFilter() throws FoxtrotException, JsonProcessingException { GroupRequest groupRequest = new GroupRequest(); groupRequest.setTable(TestUtils.TEST_TABLE_NAME); groupRequest.setNesting(Arrays.asList("os", "device", "version")); Map<String, Object> response = Maps.newHashMap(); final Map<String, Object> nexusResponse = new HashMap<String, Object>() {{ put("1", 2L); put("2", 2L); put("3", 1L); }}; final Map<String, Object> galaxyResponse = new HashMap<String, Object>() {{ put("2", 1L); put("3", 1L); }}; response.put("android", new HashMap<String, Object>() {{ put("nexus", nexusResponse); put("galaxy", galaxyResponse); }}); final Map<String, Object> nexusResponse2 = new HashMap<String, Object>() {{ put("2", 1L); }}; final Map<String, Object> iPadResponse = new HashMap<String, Object>() {{ put("2", 2L); }}; final Map<String, Object> iPhoneResponse = new HashMap<String, Object>() {{ put("1", 1L); }}; response.put("ios", new HashMap<String, Object>() {{ put("nexus", nexusResponse2); put("ipad", iPadResponse); put("iphone", iPhoneResponse); }}); GroupResponse actualResult = GroupResponse.class.cast(getQueryExecutor().execute(groupRequest)); assertEquals(response, actualResult.getResult()); }
@Override public ActionResponse execute(GroupRequest parameter) { SearchRequestBuilder query = getRequestBuilder(parameter); try { SearchResponse response = query.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } }
GroupAction extends Action<GroupRequest> { @Override public ActionResponse execute(GroupRequest parameter) { SearchRequestBuilder query = getRequestBuilder(parameter); try { SearchResponse response = query.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } }
GroupAction extends Action<GroupRequest> { @Override public ActionResponse execute(GroupRequest parameter) { SearchRequestBuilder query = getRequestBuilder(parameter); try { SearchResponse response = query.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } GroupAction(GroupRequest parameter, AnalyticsLoader analyticsLoader); }
GroupAction extends Action<GroupRequest> { @Override public ActionResponse execute(GroupRequest parameter) { SearchRequestBuilder query = getRequestBuilder(parameter); try { SearchResponse response = query.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } GroupAction(GroupRequest parameter, AnalyticsLoader analyticsLoader); @Override void preprocess(); @Override String getMetricKey(); @Override String getRequestCacheKey(); @Override void validateImpl(GroupRequest parameter); @Override ActionResponse execute(GroupRequest parameter); @Override SearchRequestBuilder getRequestBuilder(GroupRequest parameter); @Override ActionResponse getResponse(org.elasticsearch.action.ActionResponse response, GroupRequest parameter); }
GroupAction extends Action<GroupRequest> { @Override public ActionResponse execute(GroupRequest parameter) { SearchRequestBuilder query = getRequestBuilder(parameter); try { SearchResponse response = query.execute() .actionGet(getGetQueryTimeout()); return getResponse(response, parameter); } catch (ElasticsearchException e) { throw FoxtrotExceptions.createQueryExecutionException(parameter, e); } } GroupAction(GroupRequest parameter, AnalyticsLoader analyticsLoader); @Override void preprocess(); @Override String getMetricKey(); @Override String getRequestCacheKey(); @Override void validateImpl(GroupRequest parameter); @Override ActionResponse execute(GroupRequest parameter); @Override SearchRequestBuilder getRequestBuilder(GroupRequest parameter); @Override ActionResponse getResponse(org.elasticsearch.action.ActionResponse response, GroupRequest parameter);  }