assertThat(nameB, is(sourceB.getName()));
}
@Test
public void testIfEOUpdateWorksCorrectly_shouldUpdateSourceModel() throws Exception {
SourceModelA sourceA = new SourceModelA("sourceA/2", "sourceNameA", "shared");
SourceModelB sourceB = new SourceModelB("sourceB/2", "sourceNameB", "shared");
persist.commit(getTestEKBCommit().addInsert(sourceA).addInsert(sourceB));
EOModel eo = new EOModel("eo/2", sourceA.getEdbId(), sourceB.getEdbId(), "shared");
persist.commit(getTestEKBCommit().addInsert(eo));
eo = query.getModel(EOModel.class, getModelOid(eo.getEdbId()));
eo.setNameA("updatedNameA");
eo.setShared("updatedShared");
persist.commit(getTestEKBCommit().addUpdate(eo));
sourceA = query.getModel(SourceModelA.class, getModelOid(sourceA.getEdbId()));
sourceB = query.getModel(SourceModelB.class, getModelOid(sourceB.getEdbId()));
assertThat(sourceA.getName(), is("updatedNameA"));
assertThat(sourceA.getShared(), is("updatedShared"));
assertThat(sourceB.getShared(), is("updatedShared"));
}