use of org.neo4j.bolt.v1.runtime.StatementProcessor in project neo4j by neo4j.
the class BoltMatchers method hasTransaction.
public static Matcher<BoltStateMachine> hasTransaction() {
return new BaseMatcher<BoltStateMachine>() {
@Override
public boolean matches(final Object item) {
final BoltStateMachine machine = (BoltStateMachine) item;
final StatementProcessor statementProcessor = machine.statementProcessor();
return statementProcessor != null && statementProcessor.hasTransaction();
}
@Override
public void describeTo(Description description) {
description.appendText("no transaction");
}
};
}
use of org.neo4j.bolt.v1.runtime.StatementProcessor in project neo4j by neo4j.
the class BoltMatchers method hasNoTransaction.
public static Matcher<BoltStateMachine> hasNoTransaction() {
return new BaseMatcher<BoltStateMachine>() {
@Override
public boolean matches(final Object item) {
final BoltStateMachine machine = (BoltStateMachine) item;
final StatementProcessor statementProcessor = machine.statementProcessor();
return statementProcessor == null || !statementProcessor.hasTransaction();
}
@Override
public void describeTo(Description description) {
description.appendText("no transaction");
}
};
}
Aggregations