use of org.glassfish.admin.rest.model.RelatedModel in project Payara by payara.
the class ModelExtensionTest method testNestedModels.
@Test
public void testNestedModels() {
BaseModel model = CompositeUtil.instance().getModel(BaseModel.class);
List<RelatedModel> related = model.getRelated();
Assert.assertNull(related);
RelatedModel rm = CompositeUtil.instance().getModel(RelatedModel.class);
rm.setId("1");
rm.setDescription("test");
related = new ArrayList<RelatedModel>();
related.add(rm);
model.setRelated(related);
related = model.getRelated();
Assert.assertEquals(related.size(), 1);
}
Aggregations