@Test public void primeQueryUsingPrimeMethod() throws Exception { stubFor(post(urlEqualTo(PRIME_QUERY_PATH)).willReturn(aResponse().withStatus(200))); PrimingRequest pr = PrimingRequest.queryBuilder() .withQuery("select * from people") .withRows(Collections.<Map<String, ?>>emptyList()) .build(); underTest.prime(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\":[],\"result\":\"success\"}}"))); }
public void prime(PrimingRequest prime) throws PrimeFailedException { if (prime.primeType == PrimingRequest.PrimingRequestBuilder.PrimeType.QUERY) { this.primeQuery(prime); } else { this.primePreparedStatement(prime); } }
PrimingClient { public void prime(PrimingRequest prime) throws PrimeFailedException { if (prime.primeType == PrimingRequest.PrimingRequestBuilder.PrimeType.QUERY) { this.primeQuery(prime); } else { this.primePreparedStatement(prime); } } }
PrimingClient { public void prime(PrimingRequest prime) throws PrimeFailedException { if (prime.primeType == PrimingRequest.PrimingRequestBuilder.PrimeType.QUERY) { this.primeQuery(prime); } else { this.primePreparedStatement(prime); } } private  PrimingClient(String host, int port); }
PrimingClient { public void prime(PrimingRequest prime) throws PrimeFailedException { if (prime.primeType == PrimingRequest.PrimingRequestBuilder.PrimeType.QUERY) { this.primeQuery(prime); } else { this.primePreparedStatement(prime); } } 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 { public void prime(PrimingRequest prime) throws PrimeFailedException { if (prime.primeType == PrimingRequest.PrimingRequestBuilder.PrimeType.QUERY) { this.primeQuery(prime); } else { this.primePreparedStatement(prime); } } 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; }