diff --git a/dao-api/src/test/java/com/linkedin/metadata/dao/BaseLocalDAOAspectVersionTest.java b/dao-api/src/test/java/com/linkedin/metadata/dao/BaseLocalDAOAspectVersionTest.java new file mode 100644 index 000000000..d1e1abdd7 --- /dev/null +++ b/dao-api/src/test/java/com/linkedin/metadata/dao/BaseLocalDAOAspectVersionTest.java @@ -0,0 +1,162 @@ +package com.linkedin.metadata.dao; + +import static com.linkedin.metadata.dao.BaseLocalDAOTest.DummyLocalDAO; +import static com.linkedin.metadata.dao.BaseLocalDAOTest.DummyTransactionRunner; +import com.linkedin.common.AuditStamp; +import com.linkedin.data.DataMap; +import com.linkedin.data.template.RecordTemplate; +import com.linkedin.metadata.dao.producer.BaseMetadataEventProducer; +import com.linkedin.metadata.dao.producer.BaseTrackingMetadataEventProducer; +import com.linkedin.metadata.dao.tracking.BaseTrackingManager; +import com.linkedin.metadata.dao.utils.RecordUtils; +import com.linkedin.metadata.query.ExtraInfo; +import com.linkedin.testing.AspectVersioned; +import com.linkedin.testing.EntityAspectUnionVersioned; +import com.linkedin.testing.urn.FooUrn; +import java.net.URISyntaxException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.BiFunction; +import org.mockito.stubbing.OngoingStubbing; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import static com.linkedin.common.AuditStamps.*; +import static org.mockito.Mockito.*; +import static org.testng.Assert.*; + + +public class BaseLocalDAOAspectVersionTest { + + private DummyLocalDAO _dummyLocalDAO; + private AuditStamp _dummyAuditStamp; + private BaseMetadataEventProducer _mockEventProducer; + private BaseTrackingMetadataEventProducer _mockTrackingEventProducer; + private BaseTrackingManager _mockTrackingManager; + private BiFunction, BaseLocalDAO.AspectEntry> _mockGetLatestFunction; + private DummyTransactionRunner _mockTransactionRunner; + + @BeforeMethod + public void setup() { + _mockGetLatestFunction = mock(BiFunction.class); + _mockEventProducer = mock(BaseMetadataEventProducer.class); + _mockTrackingEventProducer = mock(BaseTrackingMetadataEventProducer.class); + _mockTrackingManager = mock(BaseTrackingManager.class); + _mockTransactionRunner = spy(DummyTransactionRunner.class); + _dummyLocalDAO = new DummyLocalDAO(EntityAspectUnionVersioned.class, + _mockGetLatestFunction, _mockEventProducer, _mockTransactionRunner); + _dummyLocalDAO.setEmitAuditEvent(true); + _dummyLocalDAO.setEmitAspectSpecificAuditEvent(true); + _dummyAuditStamp = makeAuditStamp("foo", 1234); + } + + private BaseLocalDAO.AspectEntry makeAspectEntry(T aspect, + AuditStamp auditStamp) { + ExtraInfo extraInfo = null; + if (auditStamp != null) { + extraInfo = new ExtraInfo().setAudit(auditStamp); + } + return new BaseLocalDAO.AspectEntry<>(aspect, extraInfo); + } + + private void expectGetLatest(FooUrn urn, Class aspectClass, + List> returnValues) { + OngoingStubbing> ongoing = when(_mockGetLatestFunction.apply(urn, aspectClass)); + for (BaseLocalDAO.AspectEntry value : returnValues) { + ongoing = ongoing.thenReturn(value); + } + } + + @Test(description = "Test MAE emission triggered by incoming aspects with higher versions") + public void testMAEEmissionOnVerChange() throws URISyntaxException { + FooUrn urn = new FooUrn(1); + AspectVersioned foo1 = new AspectVersioned().setValue("foo1"); + AspectVersioned ver010101 = RecordUtils.toRecordTemplate(AspectVersioned.class, createVersionDataMap(1, 1, 1, "ver1")); + AspectVersioned ver020101 = RecordUtils.toRecordTemplate(AspectVersioned.class, createVersionDataMap(2, 1, 1, "ver2")); + + // Test that a version bump without a value change will still cause aspect to be written + AspectVersioned ver020201OldValue = RecordUtils.toRecordTemplate(AspectVersioned.class, createVersionDataMap(2, 2, 1, "ver2")); + + AuditStamp auditStamp2 = makeAuditStamp("tester", 5678L); + AuditStamp auditStamp3 = makeAuditStamp("tester", 5679L); + AuditStamp auditStamp4 = makeAuditStamp("tester", 5680L); + + _dummyLocalDAO.setAlwaysEmitAuditEvent(false); + expectGetLatest(urn, AspectVersioned.class, + Arrays.asList(makeAspectEntry(null, null), makeAspectEntry(foo1, _dummyAuditStamp), + makeAspectEntry(ver010101, auditStamp2), makeAspectEntry(ver020101, auditStamp3), makeAspectEntry(ver020201OldValue, auditStamp4))); + + _dummyLocalDAO.add(urn, foo1, _dummyAuditStamp); + _dummyLocalDAO.add(urn, ver010101, auditStamp2); + _dummyLocalDAO.add(urn, ver020101, auditStamp3); + _dummyLocalDAO.add(urn, ver020201OldValue, auditStamp4); + + verify(_mockEventProducer, times(1)).produceMetadataAuditEvent(urn, null, foo1); + verify(_mockEventProducer, times(1)).produceAspectSpecificMetadataAuditEvent(urn, null, foo1, _dummyAuditStamp); + verify(_mockEventProducer, times(1)).produceMetadataAuditEvent(urn, foo1, ver010101); + verify(_mockEventProducer, times(1)).produceAspectSpecificMetadataAuditEvent(urn, foo1, ver010101, auditStamp2); + verify(_mockEventProducer, times(1)).produceMetadataAuditEvent(urn, ver010101, ver020101); + verify(_mockEventProducer, times(1)).produceAspectSpecificMetadataAuditEvent(urn, ver010101, ver020101, auditStamp3); + verify(_mockEventProducer, times(1)).produceMetadataAuditEvent(urn, ver020101, ver020201OldValue); + verify(_mockEventProducer, times(1)).produceAspectSpecificMetadataAuditEvent(urn, ver020101, ver020201OldValue, auditStamp4); + verifyNoMoreInteractions(_mockEventProducer); + } + + @Test(description = "Test that no MAEs are emitted if incoming aspect has a lower version than existing aspect") + public void testMAEEmissionVerNoChange() throws URISyntaxException { + FooUrn urn = new FooUrn(1); + AspectVersioned ver020101 = RecordUtils.toRecordTemplate(AspectVersioned.class, createVersionDataMap(2, 1, 1, "ver2")); + AspectVersioned foo1 = new AspectVersioned().setValue("foo"); + AspectVersioned ver010101 = RecordUtils.toRecordTemplate(AspectVersioned.class, createVersionDataMap(1, 1, 1, "ver1")); + + _dummyLocalDAO.setAlwaysEmitAuditEvent(false); + expectGetLatest(urn, AspectVersioned.class, + Arrays.asList(makeAspectEntry(null, null), makeAspectEntry(ver020101, _dummyAuditStamp))); + + _dummyLocalDAO.add(urn, ver020101, _dummyAuditStamp); + _dummyLocalDAO.add(urn, foo1, _dummyAuditStamp); + _dummyLocalDAO.add(urn, ver010101, _dummyAuditStamp); + _dummyLocalDAO.add(urn, ver020101, _dummyAuditStamp); + + verify(_mockEventProducer, times(1)).produceMetadataAuditEvent(urn, null, ver020101); + verify(_mockEventProducer, times(1)).produceAspectSpecificMetadataAuditEvent(urn, null, ver020101, _dummyAuditStamp); + verifyNoMoreInteractions(_mockEventProducer); + } + + @Test(description = "Test aspectVersionSkipWrite") + public void testAspectVersionSkipWrite() throws URISyntaxException { + AspectVersioned ver010101 = RecordUtils.toRecordTemplate(AspectVersioned.class, createVersionDataMap(1, 1, 1, "testValue1")); + AspectVersioned ver020101 = RecordUtils.toRecordTemplate(AspectVersioned.class, createVersionDataMap(2, 1, 1, "testValue2")); + AspectVersioned noVer = new AspectVersioned().setValue("noVer"); + + // Cases where the version check will force writing to be skipped + assertEquals(_dummyLocalDAO.aspectVersionSkipWrite(ver010101, ver020101), true); + assertEquals(_dummyLocalDAO.aspectVersionSkipWrite(noVer, ver010101), true); + assertEquals(_dummyLocalDAO.aspectVersionSkipWrite(null, ver010101), true); + + // Cases where the version check will NOT force writing to be skipped + assertEquals(_dummyLocalDAO.aspectVersionSkipWrite(ver010101, ver010101), false); + assertEquals(_dummyLocalDAO.aspectVersionSkipWrite(ver020101, ver010101), false); + assertEquals(_dummyLocalDAO.aspectVersionSkipWrite(noVer, noVer), false); + assertEquals(_dummyLocalDAO.aspectVersionSkipWrite(ver010101, noVer), false); + assertEquals(_dummyLocalDAO.aspectVersionSkipWrite(ver010101, null), false); + assertEquals(_dummyLocalDAO.aspectVersionSkipWrite(null, null), false); + } + + // Helper function to create DataMap with fields baseSemanticVersion and value + private DataMap createVersionDataMap(int major, int minor, int patch, String value) { + Map versionMap = new HashMap<>(); + versionMap.put("major", major); + versionMap.put("minor", minor); + versionMap.put("patch", patch); + DataMap innerMap = new DataMap(versionMap); + Map recordMap = new HashMap<>(); + recordMap.put("baseSemanticVersion", innerMap); + recordMap.put("value", value); + + return new DataMap(recordMap); + } + +} diff --git a/dao-api/src/test/java/com/linkedin/metadata/dao/BaseLocalDAOTest.java b/dao-api/src/test/java/com/linkedin/metadata/dao/BaseLocalDAOTest.java index 56f9e4e3d..38d38a9d8 100644 --- a/dao-api/src/test/java/com/linkedin/metadata/dao/BaseLocalDAOTest.java +++ b/dao-api/src/test/java/com/linkedin/metadata/dao/BaseLocalDAOTest.java @@ -1,16 +1,15 @@ package com.linkedin.metadata.dao; import com.linkedin.common.AuditStamp; -import com.linkedin.data.DataMap; import com.linkedin.data.template.RecordTemplate; import com.linkedin.data.template.SetMode; +import com.linkedin.data.template.UnionTemplate; import com.linkedin.metadata.dao.builder.BaseLocalRelationshipBuilder.LocalRelationshipUpdates; import com.linkedin.metadata.dao.producer.BaseMetadataEventProducer; import com.linkedin.metadata.dao.producer.BaseTrackingMetadataEventProducer; import com.linkedin.metadata.dao.retention.TimeBasedRetention; import com.linkedin.metadata.dao.retention.VersionBasedRetention; import com.linkedin.metadata.dao.tracking.BaseTrackingManager; -import com.linkedin.metadata.dao.utils.RecordUtils; import com.linkedin.metadata.events.IngestionMode; import com.linkedin.metadata.events.IngestionTrackingContext; import com.linkedin.metadata.query.ExtraInfo; @@ -25,7 +24,6 @@ import java.sql.Timestamp; import java.util.Arrays; import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; @@ -53,21 +51,21 @@ public T run(Supplier block) { } } - static class DummyLocalDAO extends BaseLocalDAO { + static class DummyLocalDAO extends BaseLocalDAO { private final BiFunction, AspectEntry> _getLatestFunction; private final DummyTransactionRunner _transactionRunner; - public DummyLocalDAO(BiFunction, AspectEntry> getLatestFunction, + public DummyLocalDAO(Class aspectClass, BiFunction, AspectEntry> getLatestFunction, BaseMetadataEventProducer eventProducer, DummyTransactionRunner transactionRunner) { - super(EntityAspectUnion.class, eventProducer, FooUrn.class); + super(aspectClass, eventProducer, FooUrn.class); _getLatestFunction = getLatestFunction; _transactionRunner = transactionRunner; } - public DummyLocalDAO(BiFunction, AspectEntry> getLatestFunction, + public DummyLocalDAO(Class aspectClass, BiFunction, AspectEntry> getLatestFunction, BaseTrackingMetadataEventProducer eventProducer, BaseTrackingManager trackingManager, DummyTransactionRunner transactionRunner) { - super(EntityAspectUnion.class, eventProducer, trackingManager, FooUrn.class); + super(aspectClass, eventProducer, trackingManager, FooUrn.class); _getLatestFunction = getLatestFunction; _transactionRunner = transactionRunner; } @@ -202,7 +200,7 @@ public long newNumericId(String namespace, int maxTransactionRetry) { } } - private DummyLocalDAO _dummyLocalDAO; + private DummyLocalDAO _dummyLocalDAO; private AuditStamp _dummyAuditStamp; private BaseMetadataEventProducer _mockEventProducer; private BaseTrackingMetadataEventProducer _mockTrackingEventProducer; @@ -217,7 +215,8 @@ public void setup() { _mockTrackingEventProducer = mock(BaseTrackingMetadataEventProducer.class); _mockTrackingManager = mock(BaseTrackingManager.class); _mockTransactionRunner = spy(DummyTransactionRunner.class); - _dummyLocalDAO = new DummyLocalDAO(_mockGetLatestFunction, _mockEventProducer, _mockTransactionRunner); + _dummyLocalDAO = new DummyLocalDAO<>(EntityAspectUnion.class, _mockGetLatestFunction, _mockEventProducer, + _mockTransactionRunner); _dummyLocalDAO.setEmitAuditEvent(true); _dummyLocalDAO.setEmitAspectSpecificAuditEvent(true); _dummyAuditStamp = makeAuditStamp("foo", 1234); @@ -277,41 +276,6 @@ public void testMAEEmissionOnValueChange() throws URISyntaxException { verifyNoMoreInteractions(_mockEventProducer); } - @Test(description = "Test MAE emission triggered by incoming aspects with higher versions") - public void testMAEEmissionOnVerChange() throws URISyntaxException { - FooUrn urn = new FooUrn(1); - AspectFoo foo1 = new AspectFoo().setValue("foo1"); - AspectFoo ver010101 = RecordUtils.toRecordTemplate(AspectFoo.class, createVersionDataMap(1, 1, 1, "ver1")); - AspectFoo ver020101 = RecordUtils.toRecordTemplate(AspectFoo.class, createVersionDataMap(2, 1, 1, "ver2")); - - // Test that a version bump without a value change will still cause aspect to be written - AspectFoo ver020201OldValue = RecordUtils.toRecordTemplate(AspectFoo.class, createVersionDataMap(2, 2, 1, "ver2")); - - AuditStamp auditStamp2 = makeAuditStamp("tester", 5678L); - AuditStamp auditStamp3 = makeAuditStamp("tester", 5679L); - AuditStamp auditStamp4 = makeAuditStamp("tester", 5680L); - - _dummyLocalDAO.setAlwaysEmitAuditEvent(false); - expectGetLatest(urn, AspectFoo.class, - Arrays.asList(makeAspectEntry(null, null), makeAspectEntry(foo1, _dummyAuditStamp), - makeAspectEntry(ver010101, auditStamp2), makeAspectEntry(ver020101, auditStamp3), makeAspectEntry(ver020201OldValue, auditStamp4))); - - _dummyLocalDAO.add(urn, foo1, _dummyAuditStamp); - _dummyLocalDAO.add(urn, ver010101, auditStamp2); - _dummyLocalDAO.add(urn, ver020101, auditStamp3); - _dummyLocalDAO.add(urn, ver020201OldValue, auditStamp4); - - verify(_mockEventProducer, times(1)).produceMetadataAuditEvent(urn, null, foo1); - verify(_mockEventProducer, times(1)).produceAspectSpecificMetadataAuditEvent(urn, null, foo1, _dummyAuditStamp); - verify(_mockEventProducer, times(1)).produceMetadataAuditEvent(urn, foo1, ver010101); - verify(_mockEventProducer, times(1)).produceAspectSpecificMetadataAuditEvent(urn, foo1, ver010101, auditStamp2); - verify(_mockEventProducer, times(1)).produceMetadataAuditEvent(urn, ver010101, ver020101); - verify(_mockEventProducer, times(1)).produceAspectSpecificMetadataAuditEvent(urn, ver010101, ver020101, auditStamp3); - verify(_mockEventProducer, times(1)).produceMetadataAuditEvent(urn, ver020101, ver020201OldValue); - verify(_mockEventProducer, times(1)).produceAspectSpecificMetadataAuditEvent(urn, ver020101, ver020201OldValue, auditStamp4); - verifyNoMoreInteractions(_mockEventProducer); - } - @Test public void testMAEEmissionNoValueChange() throws URISyntaxException { FooUrn urn = new FooUrn(1); @@ -331,27 +295,6 @@ public void testMAEEmissionNoValueChange() throws URISyntaxException { verifyNoMoreInteractions(_mockEventProducer); } - @Test(description = "Test that no MAEs are emitted if incoming aspect has a lower version than existing aspect") - public void testMAEEmissionVerNoChange() throws URISyntaxException { - FooUrn urn = new FooUrn(1); - AspectFoo ver020101 = RecordUtils.toRecordTemplate(AspectFoo.class, createVersionDataMap(2, 1, 1, "ver2")); - AspectFoo foo1 = new AspectFoo().setValue("foo"); - AspectFoo ver010101 = RecordUtils.toRecordTemplate(AspectFoo.class, createVersionDataMap(1, 1, 1, "ver1")); - - _dummyLocalDAO.setAlwaysEmitAuditEvent(false); - expectGetLatest(urn, AspectFoo.class, - Arrays.asList(makeAspectEntry(null, null), makeAspectEntry(ver020101, _dummyAuditStamp))); - - _dummyLocalDAO.add(urn, ver020101, _dummyAuditStamp); - _dummyLocalDAO.add(urn, foo1, _dummyAuditStamp); - _dummyLocalDAO.add(urn, ver010101, _dummyAuditStamp); - _dummyLocalDAO.add(urn, ver020101, _dummyAuditStamp); - - verify(_mockEventProducer, times(1)).produceMetadataAuditEvent(urn, null, ver020101); - verify(_mockEventProducer, times(1)).produceAspectSpecificMetadataAuditEvent(urn, null, ver020101, _dummyAuditStamp); - verifyNoMoreInteractions(_mockEventProducer); - } - @Test public void testMAEWithNullValue() throws URISyntaxException { FooUrn urn = new FooUrn(1); @@ -375,7 +318,8 @@ public void testMAEv5WithTracking() throws URISyntaxException { FooUrn urn = new FooUrn(1); AspectFoo foo = new AspectFoo().setValue("foo"); IngestionTrackingContext mockTrackingContext = mock(IngestionTrackingContext.class); - DummyLocalDAO dummyLocalDAO = new DummyLocalDAO(_mockGetLatestFunction, _mockTrackingEventProducer, _mockTrackingManager, + DummyLocalDAO dummyLocalDAO = new DummyLocalDAO<>(EntityAspectUnion.class, + _mockGetLatestFunction, _mockTrackingEventProducer, _mockTrackingManager, _dummyLocalDAO._transactionRunner); dummyLocalDAO.setEmitAuditEvent(true); dummyLocalDAO.setAlwaysEmitAuditEvent(true); @@ -538,7 +482,8 @@ public void testAddForBackfillEventsWhenWeShouldNotDoBackfill( extraInfo.setAudit(oldAuditStamp); extraInfo.setEmitTime(oldEmitTime, SetMode.IGNORE_NULL); - DummyLocalDAO dummyLocalDAO = new DummyLocalDAO(_mockGetLatestFunction, _mockTrackingEventProducer, _mockTrackingManager, + DummyLocalDAO dummyLocalDAO = new DummyLocalDAO<>(EntityAspectUnion.class, + _mockGetLatestFunction, _mockTrackingEventProducer, _mockTrackingManager, _dummyLocalDAO._transactionRunner); dummyLocalDAO.setEmitAuditEvent(true); dummyLocalDAO.setAlwaysEmitAuditEvent(true); @@ -595,7 +540,8 @@ public void testAddForBackfill( extraInfo.setAudit(oldAuditStamp); extraInfo.setEmitTime(oldEmitTime, SetMode.IGNORE_NULL); - DummyLocalDAO dummyLocalDAO = new DummyLocalDAO(_mockGetLatestFunction, _mockTrackingEventProducer, _mockTrackingManager, + DummyLocalDAO dummyLocalDAO = new DummyLocalDAO<>(EntityAspectUnion.class, + _mockGetLatestFunction, _mockTrackingEventProducer, _mockTrackingManager, _dummyLocalDAO._transactionRunner); dummyLocalDAO.setEmitAuditEvent(true); dummyLocalDAO.setAlwaysEmitAuditEvent(true); @@ -621,7 +567,8 @@ public void testAddForBackfillWhenLatestIsNull() throws URISyntaxException { AuditStamp oldAuditStamp = makeAuditStamp("nonSusActor", 5L); extraInfo.setAudit(oldAuditStamp); - DummyLocalDAO dummyLocalDAO = new DummyLocalDAO(_mockGetLatestFunction, _mockTrackingEventProducer, _mockTrackingManager, + DummyLocalDAO dummyLocalDAO = new DummyLocalDAO<>(EntityAspectUnion.class, + _mockGetLatestFunction, _mockTrackingEventProducer, _mockTrackingManager, _dummyLocalDAO._transactionRunner); dummyLocalDAO.setEmitAuditEvent(true); dummyLocalDAO.setAlwaysEmitAuditEvent(true); @@ -644,38 +591,4 @@ public void testAddForBackfillWhenLatestIsNull() throws URISyntaxException { verifyNoMoreInteractions(_mockTrackingEventProducer); } - @Test(description = "Test aspectVersionSkipWrite") - public void testAspectVersionSkipWrite() throws URISyntaxException { - AspectFoo ver010101 = RecordUtils.toRecordTemplate(AspectFoo.class, createVersionDataMap(1, 1, 1, "testValue1")); - AspectFoo ver020101 = RecordUtils.toRecordTemplate(AspectFoo.class, createVersionDataMap(2, 1, 1, "testValue2")); - AspectFoo noVer = new AspectFoo().setValue("noVer"); - - // Cases where the version check will force writing to be skipped - assertEquals(_dummyLocalDAO.aspectVersionSkipWrite(ver010101, ver020101), true); - assertEquals(_dummyLocalDAO.aspectVersionSkipWrite(noVer, ver010101), true); - assertEquals(_dummyLocalDAO.aspectVersionSkipWrite(null, ver010101), true); - - // Cases where the version check will NOT force writing to be skipped - assertEquals(_dummyLocalDAO.aspectVersionSkipWrite(ver010101, ver010101), false); - assertEquals(_dummyLocalDAO.aspectVersionSkipWrite(ver020101, ver010101), false); - assertEquals(_dummyLocalDAO.aspectVersionSkipWrite(noVer, noVer), false); - assertEquals(_dummyLocalDAO.aspectVersionSkipWrite(ver010101, noVer), false); - assertEquals(_dummyLocalDAO.aspectVersionSkipWrite(ver010101, null), false); - assertEquals(_dummyLocalDAO.aspectVersionSkipWrite(null, null), false); - } - - // Helper function to create DataMap with fields baseSemanticVersion and value - private DataMap createVersionDataMap(int major, int minor, int patch, String value) { - Map versionMap = new HashMap<>(); - versionMap.put("major", major); - versionMap.put("minor", minor); - versionMap.put("patch", patch); - DataMap innerMap = new DataMap(versionMap); - Map recordMap = new HashMap<>(); - recordMap.put("baseSemanticVersion", innerMap); - recordMap.put("value", value); - - return new DataMap(recordMap); - } - } diff --git a/testing/test-models/src/main/pegasus/com/linkedin/testing/AspectFoo.pdl b/testing/test-models/src/main/pegasus/com/linkedin/testing/AspectFoo.pdl index c1e9b7fb4..4f133441f 100644 --- a/testing/test-models/src/main/pegasus/com/linkedin/testing/AspectFoo.pdl +++ b/testing/test-models/src/main/pegasus/com/linkedin/testing/AspectFoo.pdl @@ -1,12 +1,10 @@ namespace com.linkedin.testing -import com.linkedin.metadata.aspect.BaseVersionedAspect - /** * For unit tests */ @gma.aspect.column.name = "aspectfoo" -record AspectFoo includes BaseVersionedAspect{ +record AspectFoo { /** * For unit tests diff --git a/testing/test-models/src/main/pegasus/com/linkedin/testing/AspectFooEvolved.pdl b/testing/test-models/src/main/pegasus/com/linkedin/testing/AspectFooEvolved.pdl index 6abdf8751..dc7a7f387 100644 --- a/testing/test-models/src/main/pegasus/com/linkedin/testing/AspectFooEvolved.pdl +++ b/testing/test-models/src/main/pegasus/com/linkedin/testing/AspectFooEvolved.pdl @@ -1,11 +1,9 @@ namespace com.linkedin.testing -import com.linkedin.metadata.aspect.BaseVersionedAspect - /** * For unit tests */ -record AspectFooEvolved includes BaseVersionedAspect{ +record AspectFooEvolved { /** * For unit tests diff --git a/testing/test-models/src/main/pegasus/com/linkedin/testing/AspectVersioned.pdl b/testing/test-models/src/main/pegasus/com/linkedin/testing/AspectVersioned.pdl new file mode 100644 index 000000000..cf23c3a0d --- /dev/null +++ b/testing/test-models/src/main/pegasus/com/linkedin/testing/AspectVersioned.pdl @@ -0,0 +1,15 @@ +namespace com.linkedin.testing + +import com.linkedin.metadata.aspect.BaseVersionedAspect + +/** + * For unit tests + */ +@gma.aspect.column.name = "aspectversioned" +record AspectVersioned includes BaseVersionedAspect{ + + /** + * For unit tests + */ + value: string +} \ No newline at end of file diff --git a/testing/test-models/src/main/pegasus/com/linkedin/testing/EntityAspectUnionVersioned.pdl b/testing/test-models/src/main/pegasus/com/linkedin/testing/EntityAspectUnionVersioned.pdl new file mode 100644 index 000000000..9a2897ea8 --- /dev/null +++ b/testing/test-models/src/main/pegasus/com/linkedin/testing/EntityAspectUnionVersioned.pdl @@ -0,0 +1,6 @@ +namespace com.linkedin.testing + +/** + * For unit tests + */ +typeref EntityAspectUnionVersioned = union[AspectVersioned] \ No newline at end of file