Search in sources :

Example 1 with PlaceboTransaction

use of org.neo4j.kernel.impl.coreapi.PlaceboTransaction in project neo4j by neo4j.

the class TestPlaceboTransaction method before.

@Before
public void before() throws Exception {
    ThreadToStatementContextBridge bridge = mock(ThreadToStatementContextBridge.class);
    when(bridge.get()).thenReturn(mock(Statement.class));
    kernelTransaction = spy(KernelTransaction.class);
    Statement statement = mock(Statement.class);
    readOps = mock(ReadOperations.class);
    when(statement.readOperations()).thenReturn(readOps);
    when(bridge.get()).thenReturn(statement);
    placeboTx = new PlaceboTransaction(() -> kernelTransaction, bridge);
    resource = mock(Node.class);
    when(resource.getId()).thenReturn(1L);
}
Also used : KernelTransaction(org.neo4j.kernel.api.KernelTransaction) ReadOperations(org.neo4j.kernel.api.ReadOperations) PlaceboTransaction(org.neo4j.kernel.impl.coreapi.PlaceboTransaction) Statement(org.neo4j.kernel.api.Statement) Node(org.neo4j.graphdb.Node) ThreadToStatementContextBridge(org.neo4j.kernel.impl.core.ThreadToStatementContextBridge) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 Node (org.neo4j.graphdb.Node)1 KernelTransaction (org.neo4j.kernel.api.KernelTransaction)1 ReadOperations (org.neo4j.kernel.api.ReadOperations)1 Statement (org.neo4j.kernel.api.Statement)1 ThreadToStatementContextBridge (org.neo4j.kernel.impl.core.ThreadToStatementContextBridge)1 PlaceboTransaction (org.neo4j.kernel.impl.coreapi.PlaceboTransaction)1