JenaAdapter implements Wrapper { boolean contains(Axiom<?> axiom, URI context) { beginTransactionIfNotActive(); return new MainAxiomLoader(connector, inferenceConnector).contains(axiom, context); } JenaAdapter(StorageConnector connector, InferredStorageConnector inferenceConnector); ListHandler<SimpleListDescriptor, SimpleListValueDescriptor> simpleListHandler(); ListHandler<ReferencedListDescriptor, ReferencedListValueDescriptor> referencedListHandler(); @Override T unwrap(Class<T> cls);  }
@Test void containsStartsTransactionWhenItIsNotActive() { final String typeUri = Generator.generateUri().toString(); final Axiom<?> ax = new AxiomImpl<>(SUBJECT, Assertion.createClassAssertion(false), new Value<>(NamedResource.create(typeUri))); adapter.contains(ax, Generator.generateUri()); verify(connectorMock).begin(); }
@Test void containsChecksForStatementExistence() { final String typeUri = Generator.generateUri().toString(); final Axiom<?> ax = new AxiomImpl<>(SUBJECT, Assertion.createClassAssertion(false), new Value<>(NamedResource.create(typeUri))); when(connectorMock.contains(any(), any(), any(), any())).thenReturn(true); assertTrue(adapter.contains(ax, null)); }