Search in sources :

Example 1 with RelatedModel

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);
}
Also used : RelatedModel(org.glassfish.admin.rest.model.RelatedModel) BaseModel(org.glassfish.admin.rest.model.BaseModel) Test(org.testng.annotations.Test)

Aggregations

BaseModel (org.glassfish.admin.rest.model.BaseModel)1 RelatedModel (org.glassfish.admin.rest.model.RelatedModel)1 Test (org.testng.annotations.Test)1