@Test
public void testComplexModelToEDBObjectConversion_shouldWork() throws Exception {

    TestModel model = new TestModel();
    model.setId("test");
    SubModel sub = new SubModel();
    sub.setId("sub");
    sub.setValue("teststring");
    model.setSub(sub);
    ConnectorInformation id = getTestConnectorInformation();
    List<EDBObject> objects = converter.convertModelToEDBObject(model, id);
    EDBObject object = objects.get(1);
    assertThat(object.getString("sub"), is(ModelWrapper.wrap(sub).getCompleteModelOID()));
    EDBObject subObject = objects.get(0);
    assertThat(subObject.getString("id"), is("sub"));
    assertThat(subObject.getString(EDBConstants.MODEL_TYPE), is(SubModel.class.getName()));
}