Search in sources :

Example 1 with FillInDefaultsGetRequestBuilder

use of com.linkedin.restli.examples.defaults.api.FillInDefaultsGetRequestBuilder in project rest.li by linkedin.

the class TestFillInDefaultValue method testGet.

@Test(dataProvider = "testGetData")
public void testGet(Long id, HighLevelRecordWithDefault expectedRecord) throws RemoteInvocationException, IOException {
    FillInDefaultsRequestBuilders requestBuilders = new FillInDefaultsRequestBuilders();
    FillInDefaultsGetRequestBuilder getRequestBuilder = requestBuilders.get();
    GetRequest<HighLevelRecordWithDefault> req = getRequestBuilder.id(id).setParam(RestConstants.FILL_IN_DEFAULTS_PARAM, true).build();
    HighLevelRecordWithDefault actual = getClient().sendRequest(req).getResponse().getEntity();
    Assert.assertEquals(actual, expectedRecord);
}
Also used : FillInDefaultsGetRequestBuilder(com.linkedin.restli.examples.defaults.api.FillInDefaultsGetRequestBuilder) FillInDefaultsRequestBuilders(com.linkedin.restli.examples.defaults.api.FillInDefaultsRequestBuilders) HighLevelRecordWithDefault(com.linkedin.restli.examples.defaults.api.HighLevelRecordWithDefault) Test(org.testng.annotations.Test)

Example 2 with FillInDefaultsGetRequestBuilder

use of com.linkedin.restli.examples.defaults.api.FillInDefaultsGetRequestBuilder in project rest.li by linkedin.

the class TestFillInDefaultValue method testGetWithFillInDefaults.

@Test(dataProvider = "testGetDataNoFillIn")
public void testGetWithFillInDefaults(Long id, HighLevelRecordWithDefault expectedRecord) throws RemoteInvocationException {
    FillInDefaultsRequestBuilders requestBuilders = new FillInDefaultsRequestBuilders();
    FillInDefaultsGetRequestBuilder getRequestBuilder = requestBuilders.get();
    GetRequest<HighLevelRecordWithDefault> req = getRequestBuilder.id(id).build();
    HighLevelRecordWithDefault actual = getClient().sendRequest(req).getResponse().getEntity();
    Assert.assertEquals(actual, expectedRecord);
}
Also used : FillInDefaultsGetRequestBuilder(com.linkedin.restli.examples.defaults.api.FillInDefaultsGetRequestBuilder) FillInDefaultsRequestBuilders(com.linkedin.restli.examples.defaults.api.FillInDefaultsRequestBuilders) HighLevelRecordWithDefault(com.linkedin.restli.examples.defaults.api.HighLevelRecordWithDefault) Test(org.testng.annotations.Test)

Aggregations

FillInDefaultsGetRequestBuilder (com.linkedin.restli.examples.defaults.api.FillInDefaultsGetRequestBuilder)2 FillInDefaultsRequestBuilders (com.linkedin.restli.examples.defaults.api.FillInDefaultsRequestBuilders)2 HighLevelRecordWithDefault (com.linkedin.restli.examples.defaults.api.HighLevelRecordWithDefault)2 Test (org.testng.annotations.Test)2