-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem matching bytes fields #48
Comments
👋🏾 Hey There are eachKey and eachValue matching rules for dealing with maps/lists Expressions can be composed What expressions did you try with the following? I also tried to write matchers at the "hashes" level: entry("hashes", "atMost(2)") Is it possible to create a minimal reproducible example either in this repo or a separate one. It would aid the core maintainer, and myself in trying to help you out. An example from the protobuf plugin that may be useful |
Here's a repro with a bunch of different attempts at writing matchers for bytes and maps of non-string values: |
That got me a little farther. I would never have gotten the bit with the That took care of the The problem with matching on a |
I have a field like this in my Avro schema, and I'm struggling with how to write a match expression for it:
My pact setup, written in Java, looks like this (following the example from the plugin docs):
I can see in the plugin code that for
bytes
fields something is supposed to happen with AvroStrings, but I couldn't make heads or tails of it wrt how to write the matcher for the map entries. I tried unsuccessfully:entry("sha-256", "00000000")
entry("sha-256", notEmpty('00000000'))
entry("sha-256", new byte[0])
entry("sha-256", ByteBuffer.wrap(new byte[0]))
All those failed with various type conversion/class cast errors.
I also tried to write matchers at the "hashes" level:
entry("hashes", "atMost(2)")
entry("hashes", "eachValue(...)")
But those failed, because the value for "hashes" was expected to be a Map, not a String.
Right now, the only way I could get it to run the pact successfully, was by providing an empty map as a value for "hashes".
The text was updated successfully, but these errors were encountered: