From 31072614e22a8b36e90ff798ac245163307665fb Mon Sep 17 00:00:00 2001 From: Jan Wittler Date: Fri, 25 Nov 2022 18:18:32 +0100 Subject: [PATCH] fix view test for UUID resolver --- .../framework/views/impl/ChangeDerivingViewTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/tools.vitruv.framework.views.tests/src/tools/vitruv/framework/views/impl/ChangeDerivingViewTest.java b/tests/tools.vitruv.framework.views.tests/src/tools/vitruv/framework/views/impl/ChangeDerivingViewTest.java index 4c3e0cf72..07347e499 100644 --- a/tests/tools.vitruv.framework.views.tests/src/tools/vitruv/framework/views/impl/ChangeDerivingViewTest.java +++ b/tests/tools.vitruv.framework.views.tests/src/tools/vitruv/framework/views/impl/ChangeDerivingViewTest.java @@ -27,11 +27,14 @@ import allElementTypes.NonRoot; import allElementTypes.Root; +import tools.vitruv.change.atomic.EChange; import tools.vitruv.change.atomic.eobject.EobjectPackage; import tools.vitruv.change.atomic.feature.attribute.ReplaceSingleValuedEAttribute; +import tools.vitruv.change.atomic.resolve.EChangeResolverAndApplicator; import tools.vitruv.change.atomic.root.InsertRootEObject; import tools.vitruv.change.atomic.root.RootFactory; import tools.vitruv.change.atomic.root.RootPackage; +import tools.vitruv.change.atomic.uuid.UuidResolver; import tools.vitruv.change.composite.description.VitruviusChange; import tools.vitruv.framework.views.ChangeableViewSource; import tools.vitruv.framework.views.ModifiableViewSelection; @@ -47,6 +50,8 @@ public class ChangeDerivingViewTest { ChangeableViewSource mockChangeableViewSource; @Mock ModifiableViewSelection mockViewSelection; + @Mock + UuidResolver uuidResolver; @BeforeEach public void initializeMocks() { @@ -209,6 +214,10 @@ public void commitChanges() throws Exception { InsertRootEObject expectedChange = RootFactory.eINSTANCE.createInsertRootEObject(); expectedChange.setNewValue(root); expectedChange.setUri(testResourceUriString); + // validation expects the change to represent the new state, thus apply it + for (EChange change : argument.getValue().getEChanges()) { + EChangeResolverAndApplicator.applyForward(change, uuidResolver); + } assertThat(argument.getValue().getEChanges().size(), is(3)); // Create, Insert, ReplaceId assertThat(argument.getValue().getEChanges().get(1), equalsDeeply(expectedChange,