SesameConnection implements Connection { @Override public URI generateIdentifier(URI classUri) throws OntoDriverException { ensureOpen(); Objects.requireNonNull(classUri); try { return adapter.generateIdentifier(classUri); } catch (IdentifierGenerationException e) { throw new SesameDriverException(e); } } SesameConnection(SesameAdapter adapter); void setProperties(Properties properties); @Override void close(); @Override boolean isOpen(); @Override void commit(); @Override void rollback(); @Override void setAutoCommit(boolean autoCommit); @Override boolean isAutoCommit(); @Override Statement createStatement(); @Override PreparedStatement prepareStatement(String sparql); @Override boolean isConsistent(URI context); @Override List<URI> getContexts(); @Override URI generateIdentifier(URI classUri); @Override boolean contains(Axiom<?> axiom, URI context); @Override Collection<Axiom<?>> find(AxiomDescriptor descriptor); @Override void persist(AxiomValueDescriptor descriptor); @Override void update(AxiomValueDescriptor descriptor); @Override void remove(AxiomDescriptor descriptor); @Override Lists lists(); @Override Types types(); @Override Properties properties(); @Override T unwrap(Class<T> cls);  }
@Test public void testGenerateIdentifier() throws Exception { final URI classUri = URI.create("http: final URI identifier = URI .create("http: when(adapterMock.generateIdentifier(classUri)).thenReturn(identifier); final URI res = connection.generateIdentifier(classUri); assertEquals(identifier, res); verify(adapterMock).generateIdentifier(classUri); }