@SuppressWarnings("unchecked") @Test public void testRemovedService() throws Exception { Resource resource = new CoapResource("test"); ServiceReference<Resource> ref = mock(ServiceReference.class); when(bundleContext.getService(ref)).thenReturn(resource); managedServer.updated(null); managedServer.removedService(ref, resource); verify(server).remove(resource); }
@Override public void removedService(ServiceReference<Resource> reference, Resource service) { LOGGER.debug("Removing resource [{}]", service.getName()); managedServer.remove(service); context.ungetService(reference); }
ManagedServer implements ManagedService, ServiceTrackerCustomizer<Resource, Resource>, ServerEndpointRegistry { @Override public void removedService(ServiceReference<Resource> reference, Resource service) { LOGGER.debug("Removing resource [{}]", service.getName()); managedServer.remove(service); context.ungetService(reference); } }
ManagedServer implements ManagedService, ServiceTrackerCustomizer<Resource, Resource>, ServerEndpointRegistry { @Override public void removedService(ServiceReference<Resource> reference, Resource service) { LOGGER.debug("Removing resource [{}]", service.getName()); managedServer.remove(service); context.ungetService(reference); } ManagedServer(BundleContext bundleContext, EndpointFactory endpointFactory);  ManagedServer(BundleContext bundleContext, ServerInterfaceFactory serverFactory,
			EndpointFactory endpointFactory); }
ManagedServer implements ManagedService, ServiceTrackerCustomizer<Resource, Resource>, ServerEndpointRegistry { @Override public void removedService(ServiceReference<Resource> reference, Resource service) { LOGGER.debug("Removing resource [{}]", service.getName()); managedServer.remove(service); context.ungetService(reference); } ManagedServer(BundleContext bundleContext, EndpointFactory endpointFactory);  ManagedServer(BundleContext bundleContext, ServerInterfaceFactory serverFactory,
			EndpointFactory endpointFactory); @Override void updated(Dictionary<String, ?> properties); void stop(); @Override Resource addingService(ServiceReference<Resource> reference); @Override void removedService(ServiceReference<Resource> reference,
			Resource service); @Override void modifiedService(ServiceReference<Resource> reference,
			Resource service); @Override Endpoint getEndpoint(InetSocketAddress address); @Override Endpoint getEndpoint(int port); @Override Set<Endpoint> getAllEndpoints(); }
ManagedServer implements ManagedService, ServiceTrackerCustomizer<Resource, Resource>, ServerEndpointRegistry { @Override public void removedService(ServiceReference<Resource> reference, Resource service) { LOGGER.debug("Removing resource [{}]", service.getName()); managedServer.remove(service); context.ungetService(reference); } ManagedServer(BundleContext bundleContext, EndpointFactory endpointFactory);  ManagedServer(BundleContext bundleContext, ServerInterfaceFactory serverFactory,
			EndpointFactory endpointFactory); @Override void updated(Dictionary<String, ?> properties); void stop(); @Override Resource addingService(ServiceReference<Resource> reference); @Override void removedService(ServiceReference<Resource> reference,
			Resource service); @Override void modifiedService(ServiceReference<Resource> reference,
			Resource service); @Override Endpoint getEndpoint(InetSocketAddress address); @Override Endpoint getEndpoint(int port); @Override Set<Endpoint> getAllEndpoints();  }