PersistingOntologyRegistry extends WrappingRegistry implements OntologyRegistry, Updateable { @Override public void update() { extensionRegistry.list().forEach(this::update); }  void setDoPersist(final boolean doPersist); @Reference void setOntologyRegistry(final OntologyRegistry registry); @Reference void setOntologyService(final OntologyService svc); @Reference void setExtensionRegistry(final ExtensionRegistry registry); @Reference(target = "(org.fcrepo.apix.registry.role=default)") void setGeneralRegistry(final Registry registry); @Override URI put(final WebResource ontology, final URI ontologyIRI); @Override WebResource get(final URI uri); @Override void update(); @Override void update(final URI inResponseTo);  }
@Test public void updateExtensionInDomainTest() { toTest.update(extensionURI); verify(ontologyService).parseOntology(eq(resource)); }
@Test public void updateExtensionNotInDomainTest() { when(extensionRegistry.hasInDomain(extensionURI)).thenReturn(false); toTest.update(extensionURI); verifyZeroInteractions(ontologyRegistry); }
@Test public void updateTest() { when(extensionRegistry.list()).thenReturn(Arrays.asList(extensionURI, extensionURI)); toTest.update(); verify(ontologyService, times(2)).parseOntology(eq(resource)); }