when(mockedService.getObject("child2")).thenReturn(child2);
when(mockedService.getObject("child3")).thenReturn(child3);
when(mockedService.getObject("child4")).thenReturn(child4);
// test
RecursiveModel mRoot = converter.convertEDBObjectToModel(RecursiveModel.class, root);
// assert
RecursiveModel mChild1;
RecursiveModel mChild2;
RecursiveModel mChild3;
RecursiveModel mChild4;
List<RecursiveModel> rootChildren;
List<RecursiveModel> child1Children;
assertThat(mRoot.getId(), is("root"));
rootChildren = mRoot.getChildren();
assertThat(rootChildren, notNullValue());
assertThat(rootChildren.size(), is(2));
mChild1 = rootChildren.get(0);
mChild2 = rootChildren.get(1);
assertThat(mChild1.getId(), is("child1"));
assertThat(mChild2.getId(), is("child2"));
child1Children = mChild1.getChildren();
assertThat(child1Children, notNullValue());
assertThat(child1Children.size(), is(2));
mChild3 = child1Children.get(0);
mChild4 = child1Children.get(1);
assertThat(mChild3.getId(), is("child3"));
assertThat(mChild4.getId(), is("child4"));
}