@Test
public void testIfSubModelIsLoadedCorrectly_shouldLoadCorrectVersionOfSubModel() throws Exception {
TestModelDecorator model = getTestModelDecorator();
model.setEdbId("submodeltest/7");
SubModelDecorator sub = getSubModelDecorator();
sub.setName("test");
sub.setEdbId("submodeltest/7/1");
model.setSubModel(sub.getModel());
EKBCommit commit = getTestEKBCommit().addInsert(model.getModel());
persist.commit(commit);
Thread.sleep(5);
sub.setName("test2");
commit = getTestEKBCommit().addUpdate(sub.getModel());
persist.commit(commit);
sub = loadSubModel("submodeltest/7/1");
assertThat(sub.getModel(), notNullValue());
assertThat(sub.getName(), is("test2"));
model = loadTestModel("submodeltest/7");
assertThat(model.getModel(), notNullValue());
sub = new SubModelDecorator(model.getSubModel());
assertThat(sub.getModel(), notNullValue());
assertThat(sub.getName(), is("test"));
}