QueryExecutor { public <T extends ActionRequest> Action resolve(T request) throws QueryStoreException { Action action; try { action = analyticsLoader.getAction(request); } catch (Exception e) { logger.error("Error resolving action: ", e); throw new QueryStoreException(QueryStoreException.ErrorCode.ACTION_RESOLUTION_ERROR, "Error resolving action for: " + request.getClass().getCanonicalName(), e); } if (null == action) { throw new QueryStoreException(QueryStoreException.ErrorCode.UNRESOLVABLE_OPERATION, "No resolvable action could be found for: " + request.getClass().getCanonicalName()); } return action; } QueryExecutor(AnalyticsLoader analyticsLoader, ExecutorService executorService); ActionResponse execute(T request); AsyncDataToken executeAsync(T request); Action resolve(T request);  }
@Test public void testResolve() throws Exception { assertEquals(NonCacheableAction.class, queryExecutor.resolve(new NonCacheableActionRequest()).getClass()); }
@Test(expected = QueryStoreException.class) public void testResolveNonExistentAction() throws Exception { queryExecutor.resolve(new RequestWithNoAction()); }
@Test(expected = QueryStoreException.class) public void testResolveLoaderException() throws Exception { doThrow(new IOException()).when(analyticsLoader).getAction(any(ActionRequest.class)); queryExecutor.resolve(new NonCacheableActionRequest()); }