Search in sources :

Example 1 with OptionalListOSGiModel

use of org.apache.sling.models.testmodels.classes.OptionalListOSGiModel in project sling by apache.

the class OSGiInjectionTest method testOptionalListOSGiModelField.

@Test
public void testOptionalListOSGiModelField() throws Exception {
    Resource res = mock(Resource.class);
    OptionalListOSGiModel model = factory.getAdapter(res, OptionalListOSGiModel.class);
    assertNotNull(model);
    assertNull(model.getServices());
    verifyNoMoreInteractions(res);
}
Also used : OptionalListOSGiModel(org.apache.sling.models.testmodels.classes.OptionalListOSGiModel) Resource(org.apache.sling.api.resource.Resource) Test(org.junit.Test)

Aggregations

Resource (org.apache.sling.api.resource.Resource)1 OptionalListOSGiModel (org.apache.sling.models.testmodels.classes.OptionalListOSGiModel)1 Test (org.junit.Test)1