use of com.baidu.hugegraph.rest.RestResult in project hugegraph-common by hugegraph.
the class RestClientTest method testPutWithParams.
@Test
public void testPutWithParams() {
RestClient client = new RestClientImpl("/test", 1000, 200);
Map<String, Object> params = ImmutableMap.of("param1", "value1");
RestResult restResult = client.put("path", "id1", "body", params);
Assert.assertEquals(200, restResult.status());
}
use of com.baidu.hugegraph.rest.RestResult in project hugegraph-common by hugegraph.
the class RestClientTest method testPostWithMaxTotalAndPerRoute.
@Test
public // TODO: How to verify it?
void testPostWithMaxTotalAndPerRoute() {
RestClient client = new RestClientImpl("/test", 1000, 10, 5, 200);
RestResult restResult = client.post("path", "body");
Assert.assertEquals(200, restResult.status());
}
use of com.baidu.hugegraph.rest.RestResult in project hugegraph-common by hugegraph.
the class RestClientTest method testGetWithId.
@Test
public void testGetWithId() {
RestClient client = new RestClientImpl("/test", 1000, 200);
RestResult restResult = client.get("path", "id1");
Assert.assertEquals(200, restResult.status());
}
use of com.baidu.hugegraph.rest.RestResult in project hugegraph-common by hugegraph.
the class RestClientTest method testPostWithParams.
@Test
public void testPostWithParams() {
RestClient client = new RestClientImpl("/test", 1000, 200);
MultivaluedMap<String, Object> headers = ImmutableMultivaluedMap.empty();
Map<String, Object> params = ImmutableMap.of("param1", "value1");
RestResult restResult = client.post("path", "body", headers, params);
Assert.assertEquals(200, restResult.status());
}
use of com.baidu.hugegraph.rest.RestResult in project hugegraph-common by hugegraph.
the class RestClientTest method testPutWithHeaders.
@Test
public void testPutWithHeaders() {
RestClient client = new RestClientImpl("/test", 1000, 200);
MultivaluedMap<String, Object> headers = new MultivaluedHashMap<>();
headers.add("key1", "value1-1");
headers.add("key1", "value1-2");
headers.add("Content-Encoding", "gzip");
RestResult restResult = client.put("path", "id1", "body", headers);
Assert.assertEquals(200, restResult.status());
}
Aggregations