test_class.declarator: tableMetadataManager
test_class.modifier: private
test_class.original_string: private TableMetadataManager tableMetadataManager;
test_class.type: TableMetadataManager
test_class.var_name: tableMetadataManager
test_class.declarator: elasticsearchServer
test_class.modifier: private
test_class.original_string: private MockElasticsearchServer elasticsearchServer;
test_class.type: MockElasticsearchServer
test_class.var_name: elasticsearchServer
test_class.declarator: hazelcastInstance
test_class.modifier: private
test_class.original_string: private HazelcastInstance hazelcastInstance;
test_class.type: HazelcastInstance
test_class.var_name: hazelcastInstance
test_class.declarator: queryExecutor
test_class.modifier: private
test_class.original_string: private QueryExecutor queryExecutor;
test_class.type: QueryExecutor
test_class.var_name: queryExecutor
test_class.file: real-time/foxtrot/foxtrot-server/src/test/java/com/flipkart/foxtrot/server/resources/AnalyticsResourceTest.java
test_class.identifier: AnalyticsResourceTest
test_class.superclass: extends ResourceTest
test_case.body: @Test
      public void testRunSyncAsync() throws Exception {
          GroupRequest groupRequest = new GroupRequest();
          groupRequest.setTable(TestUtils.TEST_TABLE_NAME);
          groupRequest.setNesting(Arrays.asList("os", "device", "version"));
  
          Map<String, Object> expectedResponse = new LinkedHashMap<String, Object>();
  
          final Map<String, Object> nexusResponse = new LinkedHashMap<String, Object>(){{ put("1", 2); put("2", 2); put("3", 1); }};
          final Map<String, Object> galaxyResponse = new LinkedHashMap<String, Object>(){{ put("2", 1); put("3", 1); }};
          expectedResponse.put("android", new LinkedHashMap<String, Object>() {{
              put("nexus", nexusResponse);
              put("galaxy", galaxyResponse);
          }});
  
          final Map<String, Object> nexusResponse2 = new LinkedHashMap<String, Object>(){{ put("2", 1);}};
          final Map<String, Object> iPadResponse = new LinkedHashMap<String, Object>(){{ put("2", 2); }};
          final Map<String, Object> iPhoneResponse = new LinkedHashMap<String, Object>(){{ put("1", 1); }};
          expectedResponse.put("ios", new LinkedHashMap<String, Object>() {{
              put("nexus", nexusResponse2);
              put("ipad", iPadResponse);
              put("iphone", iPhoneResponse);
          }});
  
          WebResource webResource = client().resource("/v1/analytics/async");
          AsyncDataToken response = webResource.type(MediaType.APPLICATION_JSON_TYPE).post(AsyncDataToken.class, groupRequest);
          Thread.sleep(2000);
          GroupResponse actualResponse = GroupResponse.class.cast(CacheUtils.getCacheFor(response.getAction()).get(response.getKey()));
  
          assertEquals(expectedResponse, actualResponse.getResult());
      }
test_case.class_method_signature: AnalyticsResourceTest.testRunSyncAsync()
test_case.full_signature: @Test public void testRunSyncAsync()
test_case.identifier: testRunSyncAsync
test_case.invocations: setTable setNesting asList put put put put put put put put put put put put put put put resource client post type sleep cast get getCacheFor getAction getKey assertEquals getResult
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRunSyncAsync()
focal_class.declarator: logger = LoggerFactory.getLogger(AnalyticsResource.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(AnalyticsResource.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: queryExecutor
focal_class.modifier: private final
focal_class.original_string: private final QueryExecutor queryExecutor;
focal_class.type: QueryExecutor
focal_class.var_name: queryExecutor
focal_class.file: real-time/foxtrot/foxtrot-server/src/main/java/com/flipkart/foxtrot/server/resources/AnalyticsResource.java
focal_class.identifier: AnalyticsResource
focal_class.class_method_signature: AnalyticsResource.AnalyticsResource(QueryExecutor queryExecutor)
focal_class.full_signature: public  AnalyticsResource(QueryExecutor queryExecutor)
focal_class.identifier: AnalyticsResource
focal_class.modifiers: public
focal_class.parameters: (QueryExecutor queryExecutor)
focal_class.signature:  AnalyticsResource(QueryExecutor queryExecutor)
focal_class.class_method_signature: AnalyticsResource.runSync(final ActionRequest request)
focal_class.full_signature: @POST public ActionResponse runSync(final ActionRequest request)
focal_class.identifier: runSync
focal_class.modifiers: @POST public
focal_class.parameters: (final ActionRequest request)
focal_class.return: ActionResponse
focal_class.signature: ActionResponse runSync(final ActionRequest request)
focal_class.class_method_signature: AnalyticsResource.runSyncAsync(final ActionRequest request)
focal_class.full_signature: @POST @Path("/async") public AsyncDataToken runSyncAsync(final ActionRequest request)
focal_class.identifier: runSyncAsync
focal_class.modifiers: @POST @Path("/async") public
focal_class.parameters: (final ActionRequest request)
focal_class.return: AsyncDataToken
focal_class.signature: AsyncDataToken runSyncAsync(final ActionRequest request)
focal_method.body: @POST
      @Path("/async")
      public AsyncDataToken runSyncAsync(final ActionRequest request) {
          try {
              return queryExecutor.executeAsync(request);
          } catch (QueryStoreException e) {
              logger.error(String.format("Error running async request %s", request), e);
              throw new WebApplicationException(
                      Response.serverError().entity(Collections.singletonMap("error", e.getMessage())).build());
          }
      }
focal_method.class_method_signature: AnalyticsResource.runSyncAsync(final ActionRequest request)
focal_method.full_signature: @POST @Path("/async") public AsyncDataToken runSyncAsync(final ActionRequest request)
focal_method.identifier: runSyncAsync
focal_method.invocations: executeAsync error format build entity serverError singletonMap getMessage
focal_method.modifiers: @POST @Path("/async") public
focal_method.parameters: (final ActionRequest request)
focal_method.return: AsyncDataToken
focal_method.signature: AsyncDataToken runSyncAsync(final ActionRequest request)