use of org.apache.sling.models.testmodels.interfaces.SubClassModel in project sling by apache.
the class InterfaceInheritanceTest method testSimplePropertyModel.
@Test
public void testSimplePropertyModel() {
Map<String, Object> map = new HashMap<String, Object>();
map.put("superClassString", "first-value");
map.put("subClassString", "second-value");
ValueMap vm = new ValueMapDecorator(map);
Resource res = mock(Resource.class);
when(res.adaptTo(ValueMap.class)).thenReturn(vm);
SubClassModel model = factory.getAdapter(res, SubClassModel.class);
assertNotNull(model);
assertEquals("first-value", model.getSuperClassString());
assertEquals("second-value", model.getSubClassString());
}
Aggregations