use of org.neo4j.bolt.v4.messaging.RunMessage in project neo4j by neo4j.
the class AutoCommitStateIT method getBoltStateMachineInAutoCommitState.
private BoltStateMachineV4 getBoltStateMachineInAutoCommitState(String query) throws BoltConnectionFatality {
BoltStateMachineV4 machine = newStateMachine();
machine.process(newHelloMessage(), nullResponseHandler());
machine.process(new RunMessage(query, EMPTY_PARAMS), nullResponseHandler());
assertThat(machine.state()).isInstanceOf(AutoCommitState.class);
return machine;
}
use of org.neo4j.bolt.v4.messaging.RunMessage in project neo4j by neo4j.
the class ReadyStateIT method shouldMoveToAutoCommitOnRun_succ.
@Test
void shouldMoveToAutoCommitOnRun_succ() throws Throwable {
// Given
BoltStateMachineV4 machine = newStateMachine();
machine.process(newHelloMessage(), nullResponseHandler());
// When
BoltResponseRecorder recorder = new BoltResponseRecorder();
machine.process(new RunMessage("CREATE (n {k:'k'}) RETURN n.k", EMPTY_PARAMS), recorder);
// Then
RecordedBoltResponse response = recorder.nextResponse();
assertThat(response).satisfies(succeeded());
assertTrue(response.hasMetadata("fields"));
assertTrue(response.hasMetadata("t_first"));
assertThat(machine.state()).isInstanceOf(AutoCommitState.class);
}
Aggregations