Search in sources :

Example 26 with Neo4jPack

use of org.neo4j.bolt.packstream.Neo4jPack in project neo4j by neo4j.

the class BoltRequestMessageReaderV43Test method testMessageDecoding.

private static void testMessageDecoding(RequestMessage message) throws Exception {
    Neo4jPack neo4jPack = newNeo4jPack();
    BoltStateMachine stateMachine = mock(BoltStateMachine.class);
    BoltRequestMessageReader reader = requestMessageReader(stateMachine);
    PackedInputArray input = new PackedInputArray(encode(neo4jPack, message));
    Neo4jPack.Unpacker unpacker = neo4jPack.newUnpacker(input);
    reader.read(unpacker);
    verify(stateMachine).process(eq(message), any());
}
Also used : BoltStateMachine(org.neo4j.bolt.runtime.statemachine.BoltStateMachine) BoltRequestMessageReader(org.neo4j.bolt.messaging.BoltRequestMessageReader) PackedInputArray(org.neo4j.bolt.packstream.PackedInputArray) Neo4jPack(org.neo4j.bolt.packstream.Neo4jPack) BoltProtocolV43ComponentFactory.newNeo4jPack(org.neo4j.bolt.v43.BoltProtocolV43ComponentFactory.newNeo4jPack)

Aggregations

Neo4jPack (org.neo4j.bolt.packstream.Neo4jPack)26 PackedInputArray (org.neo4j.bolt.packstream.PackedInputArray)18 RequestMessage (org.neo4j.bolt.messaging.RequestMessage)14 BoltProtocolV3ComponentFactory.newNeo4jPack (org.neo4j.bolt.v3.BoltProtocolV3ComponentFactory.newNeo4jPack)10 BoltRequestMessageReader (org.neo4j.bolt.messaging.BoltRequestMessageReader)7 BoltStateMachine (org.neo4j.bolt.runtime.statemachine.BoltStateMachine)7 HashMap (java.util.HashMap)5 Test (org.junit.jupiter.api.Test)5 BoltRequestMessageWriter (org.neo4j.bolt.messaging.BoltRequestMessageWriter)5 RecordingByteChannel (org.neo4j.bolt.messaging.RecordingByteChannel)5 BufferedChannelOutput (org.neo4j.bolt.packstream.BufferedChannelOutput)5 AuthTokenDecoderTest (org.neo4j.bolt.security.auth.AuthTokenDecoderTest)5 HelloMessage (org.neo4j.bolt.v41.messaging.request.HelloMessage)5 BoltProtocolV4ComponentFactory.newNeo4jPack (org.neo4j.bolt.v4.BoltProtocolV4ComponentFactory.newNeo4jPack)4 RoutingContext (org.neo4j.bolt.v41.messaging.RoutingContext)4 PackedOutputArray (org.neo4j.bolt.packstream.PackedOutputArray)3 BoltIOException (org.neo4j.bolt.messaging.BoltIOException)2 HelloMessage (org.neo4j.bolt.v3.messaging.request.HelloMessage)2 BoltProtocolV41ComponentFactory.newNeo4jPack (org.neo4j.bolt.v41.BoltProtocolV41ComponentFactory.newNeo4jPack)2 BoltProtocolV43ComponentFactory.newNeo4jPack (org.neo4j.bolt.v43.BoltProtocolV43ComponentFactory.newNeo4jPack)2