Search in sources :

Example 1 with RecordedBoltResponse

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);
    }
}
Also used : BoltResponseRecorder(org.neo4j.bolt.testing.BoltResponseRecorder) RecordedBoltResponse(org.neo4j.bolt.testing.RecordedBoltResponse)

Example 2 with RecordedBoltResponse

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();
}
Also used : BoltResponseRecorder(org.neo4j.bolt.testing.BoltResponseRecorder) RecordedBoltResponse(org.neo4j.bolt.testing.RecordedBoltResponse)

Aggregations

BoltResponseRecorder (org.neo4j.bolt.testing.BoltResponseRecorder)2 RecordedBoltResponse (org.neo4j.bolt.testing.RecordedBoltResponse)2