use of com.linkedin.restli.examples.defaults.api.HighLevelRecordWithDefault in project rest.li by linkedin.
the class TestFillInDefaultValue method testFillInDefaultGetAllWithoutRequireDefault.
@Test(dataProvider = "testGetAllDataWithoutRequireDefault")
public void testFillInDefaultGetAllWithoutRequireDefault(List<HighLevelRecordWithDefault> expectedElements, CollectionMetadata expectedCollectionMetadata, LowLevelRecordWithDefault expectedMetadata) throws RemoteInvocationException {
FillInDefaultsRequestBuilders builders = new FillInDefaultsRequestBuilders();
GetAllRequest<HighLevelRecordWithDefault> request = builders.getAll().build();
CollectionResponse<HighLevelRecordWithDefault> actual = getClient().sendRequest(request).getResponse().getEntity();
Assert.assertEquals(actual.getElements(), expectedElements);
Assert.assertEquals(actual.getPaging(), expectedCollectionMetadata);
Assert.assertEquals(actual.getMetadataRaw(), expectedMetadata.data());
}
use of com.linkedin.restli.examples.defaults.api.HighLevelRecordWithDefault in project rest.li by linkedin.
the class TestFillInDefaultValue method testGetDataNoFillIn.
@DataProvider(name = "testGetDataNoFillIn")
private Object[][] testGetDataNoFillIn() throws CloneNotSupportedException {
DataMap data = new DataMap();
data.put("noDefaultFieldA", 1);
HighLevelRecordWithDefault expected = new HighLevelRecordWithDefault(data.clone());
return new Object[][] { { 1L, expected } };
}
use of com.linkedin.restli.examples.defaults.api.HighLevelRecordWithDefault in project rest.li by linkedin.
the class TestFillInDefaultValue method testBatchGetData.
@DataProvider(name = "testBatchGetData")
private Object[][] testBatchGetData() throws CloneNotSupportedException {
HighLevelRecordWithDefault a = new HighLevelRecordWithDefault(expectedTestData.clone()).setNoDefaultFieldA(1);
HighLevelRecordWithDefault b = new HighLevelRecordWithDefault(expectedTestData.clone()).setNoDefaultFieldA(2);
HighLevelRecordWithDefault c = new HighLevelRecordWithDefault(expectedTestData.clone()).setNoDefaultFieldA(3);
return new Object[][] { { new Long[] { 1L, 2L, 3L }, new HighLevelRecordWithDefault[] { a, b, c } } };
}
use of com.linkedin.restli.examples.defaults.api.HighLevelRecordWithDefault in project rest.li by linkedin.
the class TestFillInDefaultValue method testGetAllDataWithoutRequireDefault.
@DataProvider(name = "testGetAllDataWithoutRequireDefault")
private Object[][] testGetAllDataWithoutRequireDefault() throws CloneNotSupportedException {
final int count = 3;
List<HighLevelRecordWithDefault> elements = new ArrayList<>();
for (int i = 0; i < count; i++) {
elements.add(new HighLevelRecordWithDefault().setNoDefaultFieldA(i));
}
CollectionMetadata collectionMetadata = new CollectionMetadata().setLinks(new LinkArray()).setCount(10).setStart(0).setTotal(3);
LowLevelRecordWithDefault metadata = new LowLevelRecordWithDefault();
return new Object[][] { { elements, collectionMetadata, metadata } };
}
use of com.linkedin.restli.examples.defaults.api.HighLevelRecordWithDefault in project rest.li by linkedin.
the class TestFillInDefaultValue method testBatchFinderData.
@DataProvider(name = "testBatchFinderData")
private Object[][] testBatchFinderData() throws CloneNotSupportedException {
HighLevelRecordWithDefault expected1 = new HighLevelRecordWithDefault(expectedTestData.clone()).setNoDefaultFieldA(1);
HighLevelRecordWithDefault expected2 = new HighLevelRecordWithDefault(expectedTestData.clone()).setNoDefaultFieldA(2);
return new Object[][] { { new RecordCriteria[] { new RecordCriteria().setIntWithoutDefault(1), new RecordCriteria().setIntWithoutDefault(2) }, new HighLevelRecordWithDefault[] { expected1, expected2 } } };
}
Aggregations