-
-
Notifications
You must be signed in to change notification settings - Fork 483
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
pact-jvm-consumer: Message should return metadata as Map<String, Object> #1006
Comments
Version 4.0.5 has been released with this change |
Thanks for the fast reply.
I also noticed that on the provider side the tests will also fail when an event is produced containing the expected metadata property as long with an error message indicating the consumer expected a string, which is not correct here. Looking at the generated json of the pact, one can see that the expected metadata is also contained as string although it should be a json number:
|
4.0.6 has been released with the updated fix |
I am using au.com.dius:pact-jvm-consumer-junit5 in version 4.0.4.
When defining a pact with the MessagePactBuilder dsl, you can provide metadata through withMetadata giving a Map<String, Object>, where Object can be a raw value, a Matcher or a Generator. But the resulting Message returns its metadata as Map<String, String>.
This is a problem when integrating with messaging frameworks that also provide metadata with raw Object values instead of String (like IMessage of azure servicebus in my case) because you can't translate the pact Message to such a message representation then (at least not with hard workarounds.)
Shouldn't Message just return the raw metadata. To keep the API compatible I would propose to add something like getRawMetadata that returns Map<String, Object>.
The text was updated successfully, but these errors were encountered: