JenaServiceRegistry extends WrappingRegistry implements ServiceRegistry, Updateable { @Override public Service getService(final URI uri) { init.await(); return new ServiceImpl(uri); }  void setHttpClient(final CloseableHttpClient client); void setRegistryContainer(final URI container); void setInitializer(final Initializer initializer); @Override void setRegistryDelegate(final Registry delegate); void init(); void shutdown(); @Override void update(); @Override void update(final URI uri); @Override void register(final URI uri); @Override ServiceInstanceRegistry createInstanceRegistry(final Service service); @Override ServiceInstanceRegistry instancesOf(final Service service); @Override Service getService(final URI uri); @Override Collection<URI> list(); @Override boolean contains(final URI uri); @Override boolean hasInDomain(final URI uri);  }
@Test public void canonicalPresenceTest() { final String CANONICAL = "http: final String SERVICE = "http: final URI SERVICE_URI = URI.create(SERVICE); when(delegate.get(SERVICE_URI)).thenReturn( rdfResource(SERVICE, triple(SERVICE, RDF_TYPE, CLASS_SERVICE) + triple(SERVICE, PROP_CANONICAL, CANONICAL))); assertEquals(CANONICAL, toTest.getService(SERVICE_URI).canonicalURI().toString()); }
@Test public void noCanonicalPresentTest() { final String CANONICAL = "http: final String SERVICE = "http: final URI SERVICE_URI = URI.create(SERVICE); when(delegate.get(SERVICE_URI)).thenReturn( rdfResource(SERVICE, triple(SERVICE, RDF_TYPE, CLASS_SERVICE) + triple(SERVICE, "http: assertEquals(SERVICE, toTest.getService(SERVICE_URI).canonicalURI().toString()); }