Search in sources :

Example 6 with CoreHttpClient

use of com.couchbase.client.core.endpoint.http.CoreHttpClient in project couchbase-jvm-clients by couchbase.

the class RateLimitingIntegrationTest method enforceRateLimits.

/**
 * Makes sure that the rate limits are enforced on the server.
 */
static void enforceRateLimits() throws Exception {
    CoreHttpClient client = adminCluster.core().httpClient(RequestTarget.manager());
    CoreHttpResponse result = client.post(path("/internalSettings"), CoreCommonOptions.DEFAULT).form(UrlQueryStringBuilder.create().add("enforceLimits", true)).exec(adminCluster.core()).get();
    assertEquals(ResponseStatus.SUCCESS, result.status());
}
Also used : CoreHttpClient(com.couchbase.client.core.endpoint.http.CoreHttpClient) CoreHttpResponse(com.couchbase.client.core.endpoint.http.CoreHttpResponse)

Aggregations

CoreHttpClient (com.couchbase.client.core.endpoint.http.CoreHttpClient)6 CoreHttpResponse (com.couchbase.client.core.endpoint.http.CoreHttpResponse)4 CoreHttpRequest (com.couchbase.client.core.endpoint.http.CoreHttpRequest)2 AuthenticationFailureException (com.couchbase.client.core.error.AuthenticationFailureException)2 CouchbaseException (com.couchbase.client.core.error.CouchbaseException)2 UrlQueryStringBuilder (com.couchbase.client.core.util.UrlQueryStringBuilder)2 JsonObject (com.couchbase.client.java.json.JsonObject)2 SQLException (java.sql.SQLException)2 HashMap (java.util.HashMap)2 ExecutionException (java.util.concurrent.ExecutionException)2 JsonNode (com.couchbase.client.core.deps.com.fasterxml.jackson.databind.JsonNode)1 CoreCommonOptions (com.couchbase.client.core.endpoint.http.CoreCommonOptions)1 HttpStatusCodeException (com.couchbase.client.core.error.HttpStatusCodeException)1 Map (java.util.Map)1