Search in sources :

Example 16 with IdResponse

use of com.linkedin.restli.common.IdResponse 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)16 Test (org.testng.annotations.Test)10 Greeting (com.linkedin.restli.examples.greetings.api.Greeting)9 CreateResponse (com.linkedin.restli.client.response.CreateResponse)4 BatchCreateIdResponse (com.linkedin.restli.common.BatchCreateIdResponse)4 EmptyRecord (com.linkedin.restli.common.EmptyRecord)4 ProtocolVersion (com.linkedin.restli.common.ProtocolVersion)3 CreateIdRequestBuilder (com.linkedin.restli.client.CreateIdRequestBuilder)2 RestLiResponseException (com.linkedin.restli.client.RestLiResponseException)2 Group (com.linkedin.restli.examples.groups.api.Group)2 GroupMembershipParam (com.linkedin.restli.examples.groups.api.GroupMembershipParam)2 GroupMembershipsRequestBuilders (com.linkedin.restli.examples.groups.client.GroupMembershipsRequestBuilders)2 GroupsRequestBuilders (com.linkedin.restli.examples.groups.client.GroupsRequestBuilders)2 ServerResourceContext (com.linkedin.restli.internal.server.ServerResourceContext)2 CreateResponse (com.linkedin.restli.server.CreateResponse)2 ResourceContext (com.linkedin.restli.server.ResourceContext)2 RootBuilderWrapper (com.linkedin.restli.test.util.RootBuilderWrapper)2 DataMap (com.linkedin.data.DataMap)1 UriBuilder (com.linkedin.jersey.api.uri.UriBuilder)1 RestRequest (com.linkedin.r2.message.rest.RestRequest)1