use of org.neo4j.bolt.messaging.RequestMessage in project neo4j by neo4j.
the class HelloMessageDecoderTest method assertOriginalMessageEqualsToDecoded.
static void assertOriginalMessageEqualsToDecoded(RequestMessage originalMessage, RequestMessageDecoder decoder) throws Exception {
Neo4jPack neo4jPack = newNeo4jPack();
PackedInputArray input = new PackedInputArray(encode(neo4jPack, originalMessage));
Neo4jPack.Unpacker unpacker = neo4jPack.newUnpacker(input);
// these two steps are executed before decoding in order to select a correct decoder
unpacker.unpackStructHeader();
unpacker.unpackStructSignature();
RequestMessage deserializedMessage = decoder.decode(unpacker);
assertEquals(originalMessage, deserializedMessage);
}
use of org.neo4j.bolt.messaging.RequestMessage in project neo4j by neo4j.
the class ResetMessageDecoderTest method shouldDecodeAckFailure.
@Test
void shouldDecodeAckFailure() throws Exception {
RequestMessage message = decoder.decode(mock(Unpacker.class));
assertEquals(ResetMessage.INSTANCE, message);
verify(connection).interrupt();
}
Aggregations