Search in sources :

Example 1 with COMMIT_MESSAGE

use of org.neo4j.bolt.v3.messaging.request.CommitMessage.COMMIT_MESSAGE in project neo4j by neo4j.

the class TransactionReadyStateIT method shouldMoveToReadyOnCommit_succ.

@Test
void shouldMoveToReadyOnCommit_succ() throws Throwable {
    BoltStateMachineV3 machine = getBoltStateMachineInTxReadyState();
    // When
    BoltResponseRecorder recorder = new BoltResponseRecorder();
    machine.process(COMMIT_MESSAGE, recorder);
    // Then
    RecordedBoltResponse response = recorder.nextResponse();
    assertThat(response).satisfies(succeeded());
    assertTrue(response.hasMetadata("bookmark"));
    assertThat(machine.state()).isInstanceOf(ReadyState.class);
}
Also used : BoltStateMachineV3(org.neo4j.bolt.v3.BoltStateMachineV3) BoltResponseRecorder(org.neo4j.bolt.testing.BoltResponseRecorder) RecordedBoltResponse(org.neo4j.bolt.testing.RecordedBoltResponse) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 2 with COMMIT_MESSAGE

use of org.neo4j.bolt.v3.messaging.request.CommitMessage.COMMIT_MESSAGE in project neo4j by neo4j.

the class BoltRequestMessageV3Test method shouldHandleCommonMessages.

@Test
void shouldHandleCommonMessages() throws Throwable {
    assertSerializes(new HelloMessage(map("user_agent", "MyClient/1.0", "scheme", "basic")));
    assertSerializes(new RunMessage("CREATE (n) RETURN åäö"));
    assertSerializes(DiscardAllMessage.INSTANCE);
    assertSerializes(PullAllMessage.INSTANCE);
    assertSerializes(new BeginMessage());
    assertSerializes(COMMIT_MESSAGE);
    assertSerializes(ROLLBACK_MESSAGE);
    assertSerializes(ResetMessage.INSTANCE);
    assertSerializes(GOODBYE_MESSAGE);
}
Also used : HelloMessage(org.neo4j.bolt.v3.messaging.request.HelloMessage) BeginMessage(org.neo4j.bolt.v3.messaging.request.BeginMessage) RunMessage(org.neo4j.bolt.v3.messaging.request.RunMessage) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1 BoltResponseRecorder (org.neo4j.bolt.testing.BoltResponseRecorder)1 RecordedBoltResponse (org.neo4j.bolt.testing.RecordedBoltResponse)1 BoltStateMachineV3 (org.neo4j.bolt.v3.BoltStateMachineV3)1 BeginMessage (org.neo4j.bolt.v3.messaging.request.BeginMessage)1 HelloMessage (org.neo4j.bolt.v3.messaging.request.HelloMessage)1 RunMessage (org.neo4j.bolt.v3.messaging.request.RunMessage)1