JenaAdapter implements Wrapper { JenaPreparedStatement prepareStatement(String sparql) { beginTransactionIfNotActive(); return new JenaPreparedStatement(inferenceConnector, sparql); } JenaAdapter(StorageConnector connector, InferredStorageConnector inferenceConnector); ListHandler<SimpleListDescriptor, SimpleListValueDescriptor> simpleListHandler(); ListHandler<ReferencedListDescriptor, ReferencedListValueDescriptor> referencedListHandler(); @Override T unwrap(Class<T> cls);  }
@Test void prepareStatementReturnsNewPreparedStatement() throws Exception { final JenaPreparedStatement result = adapter.prepareStatement("SELECT * WHERE {?x ?y ?z . }"); assertNotNull(result); final Field execField = JenaStatement.class.getDeclaredField("executor"); execField.setAccessible(true); assertSame(inferredConnectorMock, execField.get(result)); }
@Test void prepareStatementStartsTransactionIfNotAlreadyActive() { adapter.prepareStatement("SELECT * WHERE {?x ?y ?z . }"); verify(connectorMock).begin(); }