SlingHttpServletRequest request = mock(SlingHttpServletRequest.class);
when(request.getAttribute(SlingBindings.class.getName())).thenReturn(bindings);
when(helper.getServices(ServiceInterface.class, null)).thenReturn(new ServiceInterface[] { service });
RequestOSGiModel model = factory.getAdapter(request, RequestOSGiModel.class);
assertNotNull(model);
assertNotNull(model.getService());
assertEquals(service, model.getService());
verify(bundleContext).registerService(eq(Runnable.class.getName()), eq(factory), any(Dictionary.class));
verify(bundleContext).addBundleListener(any(BundleListener.class));
verify(bundleContext).registerService(eq(Object.class.getName()), any(Object.class), any(Dictionary.class));
verify(bundleContext).getBundles();