@Test
public void testGetOpenEngSBModelEntriesForListOfComplexElementsWithProxiedInterface_shouldWork() throws Exception {
TestModel model = service.getModel(TestModel.class, "testoid");
List<OpenEngSBModelEntry> entries = ModelWrapper.wrap(model).toOpenEngSBModelEntries();
SubModel subModel1 = null;
SubModel subModel2 = null;
for (OpenEngSBModelEntry entry : entries) {
if (entry.getKey().equals("subs")) {
@SuppressWarnings("unchecked")
List<SubModel> subModels = (List<SubModel>) entry.getValue();
subModel1 = subModels.get(0);
subModel2 = subModels.get(1);
}
}
assertThat(subModel1, notNullValue());
assertThat(subModel2, notNullValue());
assertThat(subModel1.getId(), is("AAAAA"));
assertThat(subModel1.getValue(), is("BBBBB"));
assertThat(subModel2.getId(), is("CCCCC"));
assertThat(subModel2.getValue(), is("DDDDD"));
}