use of org.apache.sling.models.impl.injectors.ChildResourceInjector in project sling by apache.
the class ResourceModelClassesTest method setup.
@Before
public void setup() {
when(componentCtx.getBundleContext()).thenReturn(bundleContext);
when(componentCtx.getProperties()).thenReturn(new Hashtable<String, Object>());
factory = new ModelAdapterFactory();
factory.activate(componentCtx);
ValueMapInjector valueMapInjector = new ValueMapInjector();
factory.bindInjector(valueMapInjector, new ServicePropertiesMap(2, 2));
factory.bindInjector(new ChildResourceInjector(), new ServicePropertiesMap(1, 1));
factory.bindInjectAnnotationProcessorFactory(valueMapInjector, Collections.<String, Object>singletonMap(Constants.SERVICE_ID, 2L));
factory.adapterImplementations.addClassesAsAdapterAndImplementation(SimplePropertyModel.class, ArrayWrappersModel.class, ResourceModelWithRequiredField.class, ChildValueMapModel.class, ArrayPrimitivesModel.class, ChildResourceModel.class, ResourceModelWithRequiredFieldOptionalStrategy.class, ParentModel.class, ChildModel.class, ListModel.class);
}
Aggregations