Search in sources :

Example 1 with Exceptions3RequestBuilders

use of com.linkedin.restli.examples.greetings.client.Exceptions3RequestBuilders in project rest.li by linkedin.

the class TestExceptionsResource3 method testChangeRequestHeaderFromFilter.

// Test that Rest.li request filters can change request headers
@Test
public void testChangeRequestHeaderFromFilter() throws RemoteInvocationException {
    Greeting greeting = new Greeting().setId(1L).setMessage("Hello").setTone(Tone.FRIENDLY);
    Request<IdResponse<Long>> createRequest = new Exceptions3RequestBuilders().create().input(greeting).build();
    Response<IdResponse<Long>> response = getClient().sendRequest(createRequest).getResponse();
    Assert.assertEquals(response.getStatus(), HttpStatus.S_201_CREATED.getCode());
}
Also used : Greeting(com.linkedin.restli.examples.greetings.api.Greeting) IdResponse(com.linkedin.restli.common.IdResponse) Exceptions3RequestBuilders(com.linkedin.restli.examples.greetings.client.Exceptions3RequestBuilders) Test(org.testng.annotations.Test)

Aggregations

IdResponse (com.linkedin.restli.common.IdResponse)1 Greeting (com.linkedin.restli.examples.greetings.api.Greeting)1 Exceptions3RequestBuilders (com.linkedin.restli.examples.greetings.client.Exceptions3RequestBuilders)1 Test (org.testng.annotations.Test)1