use of org.neo4j.bolt.testing.RecordedBoltResponse in project neo4j by neo4j.
the class ResetFuzzTest method assertWorkerWorks.
private void assertWorkerWorks(BoltWorker worker) throws InterruptedException {
BoltResponseRecorder recorder = new BoltResponseRecorder();
worker.enqueue(machine -> machine.reset(recorder));
try {
RecordedBoltResponse response = recorder.nextResponse();
assertThat(SUCCESS, equalTo(response.message()));
assertThat(machine.state(), equalTo(BoltStateMachine.State.READY));
assertThat(liveTransactions.get(), equalTo(0L));
} catch (AssertionError e) {
throw new AssertionError(String.format("Expected session to return to good state after RESET, but " + "assertion failed: %s.%n" + "Seed: %s%n" + "Messages sent:%n" + "%s", e.getMessage(), seed, Iterables.toString(sent, "\n")), e);
}
}
use of org.neo4j.bolt.testing.RecordedBoltResponse in project neo4j by neo4j.
the class BoltConnectionIT method runAndPull.
private Object[] runAndPull(BoltStateMachine machine, String statement, Map<String, Object> params) throws Exception {
BoltResponseRecorder recorder = new BoltResponseRecorder();
machine.run(statement, params, nullResponseHandler());
machine.pullAll(recorder);
RecordedBoltResponse response = recorder.nextResponse();
assertEquals(SUCCESS, response.message());
return response.records();
}
Aggregations