use of com.linkedin.data.schema.MaskMap in project rest.li by linkedin.
the class TestMaskMap method testNestedFields.
@Test
public void testNestedFields() {
MaskMap mask = RecordTest.createMask().withRecordField(nestedMask -> nestedMask.withLocation().withOptionalLocation());
MaskTree tree = MaskCreator.createPositiveMask(PathSpecSet.of(RecordTest.fields().recordField().location(), RecordTest.fields().recordField().optionalLocation()));
Assert.assertEquals(mask.getDataMap(), tree.getDataMap());
}
use of com.linkedin.data.schema.MaskMap in project rest.li by linkedin.
the class TestMaskMap method testArrayFieldNestedProjectionWithAttributes.
@Test
public void testArrayFieldNestedProjectionWithAttributes() {
MaskMap mask = ArrayTest.createMask().withRecordArray(arrayMask -> arrayMask.withItems(RecordBar.ProjectionMask::withLocation), 5, 10);
MaskTree tree = MaskCreator.createPositiveMask(PathSpecSet.of(ArrayTest.fields().recordArray(5, 10), ArrayTest.fields().recordArray().items().location()));
Assert.assertEquals(mask.getDataMap(), tree.getDataMap());
}
use of com.linkedin.data.schema.MaskMap in project rest.li by linkedin.
the class TestMaskMap method testPrimitiveFields.
@Test
public void testPrimitiveFields() {
MaskMap mask = RecordTest.createMask().withBooleanField().withDoubleField().withEnumField().withFloatField();
MaskTree tree = MaskCreator.createPositiveMask(PathSpecSet.of(RecordTest.fields().booleanField(), RecordTest.fields().doubleField(), RecordTest.fields().enumField(), RecordTest.fields().floatField()));
Assert.assertEquals(mask.getDataMap(), tree.getDataMap());
}
use of com.linkedin.data.schema.MaskMap in project rest.li by linkedin.
the class TestMaskMap method testComplexFields.
@Test
public void testComplexFields() {
MaskMap mask = RecordTest.createMask().withRecordField().withRecordInlineField();
MaskTree tree = MaskCreator.createPositiveMask(PathSpecSet.of(RecordTest.fields().recordField(), RecordTest.fields().recordInlineField()));
Assert.assertEquals(mask.getDataMap(), tree.getDataMap());
}
use of com.linkedin.data.schema.MaskMap in project rest.li by linkedin.
the class TestMaskMap method testArrayFieldRangeAttributes.
@Test
public void testArrayFieldRangeAttributes() {
MaskMap mask = RecordTest.createMask().withArrayField(10, 15);
MaskTree tree = MaskCreator.createPositiveMask(PathSpecSet.of(RecordTest.fields().arrayField(10, 15)));
Assert.assertEquals(mask.getDataMap(), tree.getDataMap());
}
Aggregations