@Test public void testRetrievalOfASingleQueryWithSerialCLAndTimestamp() { stubFor(get(urlEqualTo(queryUrl)).willReturn(aResponse().withBody("[{\"query\":\"select * from people\",\"consistency\":\"TWO\", \"serialConsistency\":\"LOCAL_SERIAL\", \"timestamp\": 8675309}]"))); List<Query> queries = underTest.retrieveQueries(); assertEquals(1, queries.size()); assertEquals("select * from people", queries.get(0).getQuery()); assertEquals("TWO", queries.get(0).getConsistency()); assertEquals("LOCAL_SERIAL", queries.get(0).getSerialConsistency()); assertEquals(new Long(8675309), queries.get(0).getTimestamp()); }
public List<Query> retrieveQueries() { HttpGet get = new HttpGet(queryUrl); try { CloseableHttpResponse response = httpClient.execute(get); String body = EntityUtils.toString(response.getEntity()); LOGGER.debug("Received response {}", body); Query[] queries = (Query[]) gson.fromJson(body, (Class) Query[].class); LOGGER.debug("Parsed queries {}", Arrays.toString(queries)); return Arrays.asList(queries); } catch (IOException e) { LOGGER.info(REQUEST_FOR_QUERIES_FAILED, e); throw new ActivityRequestFailed(REQUEST_FOR_QUERIES_FAILED, e); } }
ActivityClient { public List<Query> retrieveQueries() { HttpGet get = new HttpGet(queryUrl); try { CloseableHttpResponse response = httpClient.execute(get); String body = EntityUtils.toString(response.getEntity()); LOGGER.debug("Received response {}", body); Query[] queries = (Query[]) gson.fromJson(body, (Class) Query[].class); LOGGER.debug("Parsed queries {}", Arrays.toString(queries)); return Arrays.asList(queries); } catch (IOException e) { LOGGER.info(REQUEST_FOR_QUERIES_FAILED, e); throw new ActivityRequestFailed(REQUEST_FOR_QUERIES_FAILED, e); } } }
ActivityClient { public List<Query> retrieveQueries() { HttpGet get = new HttpGet(queryUrl); try { CloseableHttpResponse response = httpClient.execute(get); String body = EntityUtils.toString(response.getEntity()); LOGGER.debug("Received response {}", body); Query[] queries = (Query[]) gson.fromJson(body, (Class) Query[].class); LOGGER.debug("Parsed queries {}", Arrays.toString(queries)); return Arrays.asList(queries); } catch (IOException e) { LOGGER.info(REQUEST_FOR_QUERIES_FAILED, e); throw new ActivityRequestFailed(REQUEST_FOR_QUERIES_FAILED, e); } } private  ActivityClient(String host, int port, int socketTimeout); }
ActivityClient { public List<Query> retrieveQueries() { HttpGet get = new HttpGet(queryUrl); try { CloseableHttpResponse response = httpClient.execute(get); String body = EntityUtils.toString(response.getEntity()); LOGGER.debug("Received response {}", body); Query[] queries = (Query[]) gson.fromJson(body, (Class) Query[].class); LOGGER.debug("Parsed queries {}", Arrays.toString(queries)); return Arrays.asList(queries); } catch (IOException e) { LOGGER.info(REQUEST_FOR_QUERIES_FAILED, e); throw new ActivityRequestFailed(REQUEST_FOR_QUERIES_FAILED, e); } } private  ActivityClient(String host, int port, int socketTimeout); static ActivityClientBuilder builder(); List<Query> retrieveQueries(); List<Connection> retrieveConnections(); void clearConnections(); void clearQueries(); void clearPreparedStatementPreparations(); List<PreparedStatementPreparation> retrievePreparedStatementPreparations(); void clearPreparedStatementExecutions(); void clearAllRecordedActivity(); List<PreparedStatementExecution> retrievePreparedStatementExecutions(); List<BatchExecution> retrieveBatches(); void clearBatchExecutions(); }
ActivityClient { public List<Query> retrieveQueries() { HttpGet get = new HttpGet(queryUrl); try { CloseableHttpResponse response = httpClient.execute(get); String body = EntityUtils.toString(response.getEntity()); LOGGER.debug("Received response {}", body); Query[] queries = (Query[]) gson.fromJson(body, (Class) Query[].class); LOGGER.debug("Parsed queries {}", Arrays.toString(queries)); return Arrays.asList(queries); } catch (IOException e) { LOGGER.info(REQUEST_FOR_QUERIES_FAILED, e); throw new ActivityRequestFailed(REQUEST_FOR_QUERIES_FAILED, e); } } private  ActivityClient(String host, int port, int socketTimeout); static ActivityClientBuilder builder(); List<Query> retrieveQueries(); List<Connection> retrieveConnections(); void clearConnections(); void clearQueries(); void clearPreparedStatementPreparations(); List<PreparedStatementPreparation> retrievePreparedStatementPreparations(); void clearPreparedStatementExecutions(); void clearAllRecordedActivity(); List<PreparedStatementExecution> retrievePreparedStatementExecutions(); List<BatchExecution> retrieveBatches(); void clearBatchExecutions();  }