use of org.neo4j.cypher.internal.cache.TestExecutorCaffeineCacheFactory$ in project neo4j by neo4j.
the class SnapshotExecutionEngineTest method setUp.
@BeforeEach
void setUp() throws Exception {
transactionalContext = mock(TransactionalContext.class, RETURNS_DEEP_STUBS);
KernelStatement kernelStatement = mock(KernelStatement.class);
executor = mock(SnapshotExecutionEngine.QueryExecutor.class);
versionContext = mock(VersionContext.class);
statistics = mock(QueryStatistics.class);
executionEngine = new SnapshotExecutionEngine(new GraphDatabaseCypherService(db), config, TestExecutorCaffeineCacheFactory$.MODULE$, NullLogProvider.getInstance(), mock(CompilerFactory.class));
when(transactionalContext.kernelTransaction().cursorContext()).thenReturn(new CursorContext(NULL, versionContext));
when(transactionalContext.statement()).thenReturn(kernelStatement);
var innerExecution = mock(QueryExecution.class);
when(executor.execute(any())).thenAnswer((Answer<QueryExecution>) invocationOnMock -> {
MaterialisedResult materialisedResult = invocationOnMock.getArgument(0);
materialisedResult.onResultCompleted(statistics);
return innerExecution;
});
}
Aggregations