assertThat(diff.getDifferences().size(), is(5));
}
@Test
public void testIfDifferenceCalculationWorks_shouldReturnTheCorrectChangee() throws Exception {
EngineeringObjectModel old = new EngineeringObjectModel();
old.setInternalModelName("testModel");
old.setNameA("nameA-old");
old.setNameB("nameB-old");
old.setModelAId("testreference1");
old.setModelBId("testreference2");
old.setTest("this is a teststring");
EngineeringObjectModel updated = new EngineeringObjectModel();
updated.setInternalModelName("testModel");
updated.setNameA("nameA-old");
updated.setNameB("nameB-old");
updated.setModelAId("testreference1");
updated.setModelBId("testreference2");
updated.setTest("this is a new teststring");
ModelDiff diff = ModelDiff.createModelDiff((OpenEngSBModel) old, (OpenEngSBModel) updated);
assertThat(diff.getDifferences().size(), is(1));
ModelDiffEntry entry = diff.getDifferences().values().iterator().next();
assertThat((String) entry.getBefore(), is("this is a teststring"));
assertThat((String) entry.getAfter(), is("this is a new teststring"));