use of org.neo4j.kernel.impl.util.ValueUtils.asMapValue in project neo4j by neo4j.
the class DiscardMessageTest method shouldThrowExceptionIfFailedToParseTransactionMetadataCorrectly.
@Test
void shouldThrowExceptionIfFailedToParseTransactionMetadataCorrectly() throws Throwable {
// Given
Map<String, Object> msgMetadata = map("n", "invalid value type");
MapValue meta = ValueUtils.asMapValue(msgMetadata);
// When & Then
BoltIOException exception = assertThrows(BoltIOException.class, () -> new DiscardMessage(meta));
assertThat(exception.getMessage()).startsWith("Expecting DISCARD size n to be a Long value, but got: String(\"invalid value type\")");
}
Aggregations