use of org.infinispan.client.rest.RestRawClient in project infinispan by infinispan.
the class CacheResourceV2Test method testConversionFromYAML.
@Test
public void testConversionFromYAML() throws Exception {
RestRawClient rawClient = client.raw();
String yaml = "distributedCache:\n" + " mode: 'SYNC'\n" + " memory:\n" + " storage: 'OBJECT'\n" + " maxCount: 20";
CompletionStage<RestResponse> response = rawClient.post("/rest/v2/caches?action=convert", Collections.singletonMap("Accept", APPLICATION_XML_TYPE), yaml, APPLICATION_YAML_TYPE);
assertThat(response).isOk();
checkXML(response);
response = rawClient.post("/rest/v2/caches?action=convert", Collections.singletonMap("Accept", APPLICATION_JSON_TYPE), yaml, APPLICATION_YAML_TYPE);
assertThat(response).isOk();
checkJSON(response);
}
use of org.infinispan.client.rest.RestRawClient in project infinispan by infinispan.
the class BaseCacheResourceTest method shouldReturnNotExistingOnWrongContext.
@Test
public void shouldReturnNotExistingOnWrongContext() {
putStringValueInCache("default", "test", "test");
RestRawClient rawClient = client.raw();
String path = String.format("/wrongContext/%s/%s", "default", "test");
CompletionStage<RestResponse> response = rawClient.get(path);
// then
ResponseAssertion.assertThat(response).doesntExist();
}
Aggregations