Skip to content

Commit

Permalink
use SoftAssertions for models comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
yvrng committed Jun 9, 2017
1 parent e10afb2 commit ad765f3
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import fr.inria.atlanmod.neoemf.tests.AbstractBackendTest;
import fr.inria.atlanmod.neoemf.util.emf.compare.LazyMatchEngineFactory;

import org.assertj.core.api.SoftAssertions;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
Expand Down Expand Up @@ -99,8 +100,12 @@ protected void assertNotifierAreEqual(Notifier actual, Notifier expected) {
.build()
.compare(scope);

assertThat(comparison.getConflicts()).hasSize(0);
assertThat(comparison.getDifferences()).hasSize(0);
SoftAssertions softly = new SoftAssertions();
{
softly.assertThat(comparison.getConflicts()).isEmpty();
softly.assertThat(comparison.getDifferences()).isEmpty();
}
softly.assertAll();
}

/**
Expand Down Expand Up @@ -159,7 +164,7 @@ protected void assertReferenceHas(EObject obj, String name, int index, String re
EAttribute attribute = checkNotNull(EAttribute.class.cast(eObjectReference.eClass().getEStructuralFeature("name")));
assertThat(eObjectReference.eGet(attribute)).isEqualTo(attribute.getDefaultValue());
}
catch (NullPointerException ignored) {
catch (NullPointerException expected) {
// It's not a problem if this happens
}
}
Expand Down

0 comments on commit ad765f3

Please sign in to comment.