use of org.infinispan.client.rest.impl.okhttp.StringRestEntityOkHttp in project infinispan by infinispan.
the class AbstractMultiClusterIT method createCache.
protected void createCache(String cacheName, ConfigurationBuilder builder, RestClient client) {
String cacheConfig = Common.cacheConfigToJson(cacheName, builder.build());
StringRestEntityOkHttp body = new StringRestEntityOkHttp(MediaType.APPLICATION_JSON, cacheConfig);
RestResponse response = join(client.cache(cacheName).createWithConfiguration(body));
assertEquals(response.getBody(), 200, response.getStatus());
}
use of org.infinispan.client.rest.impl.okhttp.StringRestEntityOkHttp in project infinispan by infinispan.
the class BaseRestSearchTest method write.
protected void write(int id, String contents, Method method, MediaType contentType) {
RestEntity entity = new StringRestEntityOkHttp(contentType, contents);
CompletionStage<RestResponse> response;
if (method.equals(POST)) {
response = client.cache(CACHE_NAME).post(String.valueOf(id), entity);
} else {
response = client.cache(CACHE_NAME).put(String.valueOf(id), entity);
}
ResponseAssertion.assertThat(response).isOk();
}
Aggregations