EKBCommit commit = getTestCommit().addUpdate(model);
int before = commit.getUpdates().size();
enhancer.onPreCommit(commit);
int after = commit.getUpdates().size();
assertThat(after - before == 2, is(true));
SourceModelA modelA = null;
SourceModelB modelB = null;
for (OpenEngSBModel update : commit.getUpdates()) {
if (update.retrieveModelName().equals(SourceModelA.class.getName())) {
modelA = (SourceModelA) update;
}
if (update.retrieveModelName().equals(SourceModelB.class.getName())) {
modelB = (SourceModelB) update;
}
}
assertThat(modelA.getNameA(), is("updatedFirstObject"));
assertThat(modelB.getNameB(), is("updatedSecondObject"));
}