@Test public void testPrimingQueryWithColumnTypesSpecified() { stubFor(post(urlEqualTo(PRIME_QUERY_PATH)).willReturn(aResponse().withStatus(200))); Map<String, ColumnTypes> types = ImmutableMap.of("set_column", ColumnTypes.VarcharSet); Map<String, Object> row = new HashMap<String, Object>(); List<String> set = Arrays.asList("one", "two", "three"); row.put("set_column", set); PrimingRequest pr = PrimingRequest.queryBuilder() .withQuery("select * from people") .withRows(row) .withColumnTypes(types) .build(); underTest.primeQuery(pr); verify(postRequestedFor(urlEqualTo(PRIME_QUERY_PATH)) .withHeader("Content-Type", equalTo("application/json; charset=UTF-8")) .withRequestBody(equalToJson("{\"when\":{\"query\":\"select * from people\"}," + "\"then\":{" + "\"rows\":[" + "{\"set_column\":[\"one\",\"two\",\"three\"]}]," + "\"result\":\"success\"" + ",\"column_types\":{\"set_column\":\"set<varchar>\"}}}"))); }
@Deprecated public void primeQuery(PrimingRequest primeRequest) throws PrimeFailedException { if (primeRequest.primeType != PrimingRequest.PrimingRequestBuilder.PrimeType.QUERY) { throw new IllegalArgumentException("Can't pass a prepared statement prime to primeQuery, use queryBuilder()"); } prime(primeRequest, primeQueryUrl); }
PrimingClient { @Deprecated public void primeQuery(PrimingRequest primeRequest) throws PrimeFailedException { if (primeRequest.primeType != PrimingRequest.PrimingRequestBuilder.PrimeType.QUERY) { throw new IllegalArgumentException("Can't pass a prepared statement prime to primeQuery, use queryBuilder()"); } prime(primeRequest, primeQueryUrl); } }
PrimingClient { @Deprecated public void primeQuery(PrimingRequest primeRequest) throws PrimeFailedException { if (primeRequest.primeType != PrimingRequest.PrimingRequestBuilder.PrimeType.QUERY) { throw new IllegalArgumentException("Can't pass a prepared statement prime to primeQuery, use queryBuilder()"); } prime(primeRequest, primeQueryUrl); } private  PrimingClient(String host, int port); }
PrimingClient { @Deprecated public void primeQuery(PrimingRequest primeRequest) throws PrimeFailedException { if (primeRequest.primeType != PrimingRequest.PrimingRequestBuilder.PrimeType.QUERY) { throw new IllegalArgumentException("Can't pass a prepared statement prime to primeQuery, use queryBuilder()"); } prime(primeRequest, primeQueryUrl); } private  PrimingClient(String host, int port); static PrimingClientBuilder builder(); void prime(PrimingRequest prime); void prime(PrimingRequest.PrimingRequestBuilder prime); void primeBatch(BatchPrimingRequest batchPrimingRequest); void primeBatch(BatchPrimingRequest.BatchPrimingRequestBuilder batchPrimingRequest); void multiPrime(MultiPrimeRequest primeRequest); @Deprecated void primeQuery(PrimingRequest primeRequest); @Deprecated void primePreparedStatement(PrimingRequest primeRequest); List<PrimingRequest> retrievePreparedPrimes(); List<MultiPrimeRequest> retrievePreparedMultiPrimes(); List<PrimingRequest> retrieveQueryPrimes(); void clearAllPrimes(); void clearQueryPrimes(); void clearPreparedPrimes(); void clearPreparedMultiPrimes(); void clearBatchPrimes(); }
PrimingClient { @Deprecated public void primeQuery(PrimingRequest primeRequest) throws PrimeFailedException { if (primeRequest.primeType != PrimingRequest.PrimingRequestBuilder.PrimeType.QUERY) { throw new IllegalArgumentException("Can't pass a prepared statement prime to primeQuery, use queryBuilder()"); } prime(primeRequest, primeQueryUrl); } private  PrimingClient(String host, int port); static PrimingClientBuilder builder(); void prime(PrimingRequest prime); void prime(PrimingRequest.PrimingRequestBuilder prime); void primeBatch(BatchPrimingRequest batchPrimingRequest); void primeBatch(BatchPrimingRequest.BatchPrimingRequestBuilder batchPrimingRequest); void multiPrime(MultiPrimeRequest primeRequest); @Deprecated void primeQuery(PrimingRequest primeRequest); @Deprecated void primePreparedStatement(PrimingRequest primeRequest); List<PrimingRequest> retrievePreparedPrimes(); List<MultiPrimeRequest> retrievePreparedMultiPrimes(); List<PrimingRequest> retrieveQueryPrimes(); void clearAllPrimes(); void clearQueryPrimes(); void clearPreparedPrimes(); void clearPreparedMultiPrimes(); void clearBatchPrimes(); static final String DELETING_OF_PRIMES_FAILED; static final String PRIMING_FAILED; }