use of com.baidu.hugegraph.rest.RestClient 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.RestClient 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.RestClient 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.RestClient 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.RestClient in project hugegraph-common by hugegraph.
the class RestClientTest method testPutWithException.
@Test
public void testPutWithException() {
RestClient client = new RestClientImpl("/test", 1000, 400);
Assert.assertThrows(ClientException.class, () -> {
client.put("path", "id1", "body");
});
}
Aggregations