@Test
public void testParentServiceLocator() {
final ServiceLocator locator = new ServiceLocatorImpl("MyServiceLocator", null);
final Server server = JettyHttpContainerFactory.createServer(URI.create("http://localhost:9876"),
new ResourceConfig(Resource.class), false, locator);
JettyHttpContainer container = (JettyHttpContainer) server.getHandler();
ServiceLocator appLocator = container.getApplicationHandler().getServiceLocator();
assertTrue("Application service locator was expected to have defined parent locator", appLocator.getParent() == locator);
}