use of com.linkedin.r2.message.rest.RestRequest in project rest.li by linkedin.
the class TestDebugRequestHandlers method testParseqTraceDebugPutRequestHandlerTracevis.
@Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestBuilderDataProvider")
public void testParseqTraceDebugPutRequestHandlerTracevis(RootBuilderWrapper<Long, Greeting> builders) throws URISyntaxException, ExecutionException, InterruptedException, RemoteInvocationException {
Long newId = createNewGreetingOnTheServer(builders);
RestRequest request = new RestRequestBuilder(new URI(URI_PREFIX + "greetingsPromise/" + newId + "/__debug/parseqtrace/tracevis")).setMethod("PUT").setEntity(createNewGreetingBytes(newId)).build();
sendRequestAndVerifyParseqTracevisResponse(request);
}
use of com.linkedin.r2.message.rest.RestRequest in project rest.li by linkedin.
the class TestDebugRequestHandlers method testParseqTraceDebugPostRequestHandlerRaw.
@Test
public void testParseqTraceDebugPostRequestHandlerRaw() throws URISyntaxException, ExecutionException, InterruptedException {
RestRequest request = new RestRequestBuilder(new URI(URI_PREFIX + "greetingsPromise/__debug/parseqtrace/raw")).setMethod("POST").setEntity(createNewGreetingBytes(444L)).build();
sendRequestAndVerifyParseqTraceRaw(request);
}
use of com.linkedin.r2.message.rest.RestRequest in project rest.li by linkedin.
the class TestDebugRequestHandlers method testParseqTraceDebugPostRequestHandlerTracevis.
@Test
public void testParseqTraceDebugPostRequestHandlerTracevis() throws URISyntaxException, ExecutionException, InterruptedException {
RestRequest request = new RestRequestBuilder(new URI(URI_PREFIX + "greetingsPromise/__debug/parseqtrace/tracevis")).setMethod("POST").setEntity(createNewGreetingBytes(444L)).build();
sendRequestAndVerifyParseqTracevisResponse(request);
}
use of com.linkedin.r2.message.rest.RestRequest in project rest.li by linkedin.
the class TestDebugRequestHandlers method testParseqTraceDebugPutRequestHandlerRaw.
@Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestBuilderDataProvider")
public void testParseqTraceDebugPutRequestHandlerRaw(RootBuilderWrapper<Long, Greeting> builders) throws URISyntaxException, ExecutionException, InterruptedException, RemoteInvocationException {
Long newId = createNewGreetingOnTheServer(builders);
RestRequest request = new RestRequestBuilder(new URI(URI_PREFIX + "greetingsPromise/" + newId + "/__debug/parseqtrace/raw")).setMethod("PUT").setEntity(createNewGreetingBytes(newId)).build();
sendRequestAndVerifyParseqTraceRaw(request);
}
use of com.linkedin.r2.message.rest.RestRequest in project rest.li by linkedin.
the class TestDebugRequestHandlers method sendRequestAndVerifyParseqTracevisResponse.
private void sendRequestAndVerifyParseqTracevisResponse(RestRequest request) throws InterruptedException, ExecutionException {
Future<RestResponse> restResponseFuture = getDefaultTransportClient().restRequest(request);
RestResponse restResponse = restResponseFuture.get();
Assert.assertEquals(restResponse.getStatus(), 200);
List<String> contentTypeValues = restResponse.getHeaderValues(RestConstants.HEADER_CONTENT_TYPE);
Assert.assertTrue(contentTypeValues.size() == 1);
Assert.assertEquals(contentTypeValues.get(0), HEADER_VALUE_TEXT_HTML);
}
Aggregations