use of org.neo4j.bolt.testing.BoltResponseRecorder in project neo4j by neo4j.
the class BoltStateMachineTest method shouldBeAbleToKillMessagesAheadInLineWithAnInterrupt.
@Test
public void shouldBeAbleToKillMessagesAheadInLineWithAnInterrupt() throws Throwable {
// Given
final BoltStateMachine machine = newMachine(READY);
// When
machine.interrupt();
// ...and
BoltResponseRecorder recorder = new BoltResponseRecorder();
machine.run("RETURN 1", EMPTY_PARAMS, recorder);
machine.reset(recorder);
machine.run("RETURN 1", EMPTY_PARAMS, recorder);
// Then
assertThat(recorder.nextResponse(), wasIgnored());
assertThat(recorder.nextResponse(), succeeded());
assertThat(recorder.nextResponse(), succeeded());
}
Aggregations