Search in sources :

Example 11 with MaskMap

use of com.linkedin.data.schema.MaskMap in project rest.li by linkedin.

the class TestMaskMap method testEmptyMask.

@Test
public void testEmptyMask() {
    MaskMap mask = RecordTest.createMask();
    MaskTree tree = MaskCreator.createPositiveMask(PathSpecSet.empty());
    Assert.assertEquals(mask.getDataMap(), tree.getDataMap());
}
Also used : MaskTree(com.linkedin.data.transform.filter.request.MaskTree) MaskMap(com.linkedin.data.schema.MaskMap) Test(org.testng.annotations.Test)

Example 12 with MaskMap

use of com.linkedin.data.schema.MaskMap in project rest.li by linkedin.

the class TestMaskMap method testArrayFieldDefaultProjection.

@Test
public void testArrayFieldDefaultProjection() {
    MaskMap mask = RecordTest.createMask().withArrayField();
    MaskTree tree = MaskCreator.createPositiveMask(PathSpecSet.of(RecordTest.fields().arrayField()));
    Assert.assertEquals(mask.getDataMap(), tree.getDataMap());
}
Also used : MaskTree(com.linkedin.data.transform.filter.request.MaskTree) MaskMap(com.linkedin.data.schema.MaskMap) Test(org.testng.annotations.Test)

Example 13 with MaskMap

use of com.linkedin.data.schema.MaskMap in project rest.li by linkedin.

the class TestMaskMap method testUnionFieldDefaultProjection.

@Test
public void testUnionFieldDefaultProjection() {
    MaskMap mask = UnionTest.createMask().withUnionWithAliases();
    MaskTree tree = MaskCreator.createPositiveMask(PathSpecSet.of(UnionTest.fields().unionWithAliases()));
    Assert.assertEquals(mask.getDataMap(), tree.getDataMap());
}
Also used : MaskTree(com.linkedin.data.transform.filter.request.MaskTree) MaskMap(com.linkedin.data.schema.MaskMap) Test(org.testng.annotations.Test)

Example 14 with MaskMap

use of com.linkedin.data.schema.MaskMap in project rest.li by linkedin.

the class TestMaskMap method testArrayFieldNestedProjection.

@Test
public void testArrayFieldNestedProjection() {
    MaskMap mask = ArrayTest.createMask().withRecordArray(arrayMask -> arrayMask.withItems(RecordBar.ProjectionMask::withLocation));
    MaskTree tree = MaskCreator.createPositiveMask(PathSpecSet.of(ArrayTest.fields().recordArray().items().location()));
    Assert.assertEquals(mask.getDataMap(), tree.getDataMap());
}
Also used : MaskTree(com.linkedin.data.transform.filter.request.MaskTree) MaskMap(com.linkedin.data.schema.MaskMap) Test(org.testng.annotations.Test)

Aggregations

MaskMap (com.linkedin.data.schema.MaskMap)14 Test (org.testng.annotations.Test)14 MaskTree (com.linkedin.data.transform.filter.request.MaskTree)13 DataMap (com.linkedin.data.DataMap)1 PathSpecSet (com.linkedin.data.schema.PathSpecSet)1 MaskCreator (com.linkedin.data.transform.filter.request.MaskCreator)1 UriBuilder (com.linkedin.jersey.api.uri.UriBuilder)1 WithCustomRecord (com.linkedin.pegasus.generator.test.idl.records.WithCustomRecord)1 CustomRecord (com.linkedin.pegasus.generator.test.pdl.fixtures.CustomRecord)1 HashMap (java.util.HashMap)1 Assert (org.testng.Assert)1