Skip to content
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

Allow using JSON directly in MessagePactBuilder #1669

Closed
JamesFraser-FD opened this issue Feb 21, 2023 · 3 comments
Closed

Allow using JSON directly in MessagePactBuilder #1669

JamesFraser-FD opened this issue Feb 21, 2023 · 3 comments

Comments

@JamesFraser-FD
Copy link

All examples I can see for MessagePactBuilder require constructing a DslPart object to pass into the .withContent() method

Our current project has existing JSON files and it would be nice if we could pass in this data directly, either as a String or JSONObject - similar to how ConsumerPactBuilder does already (example)

Something similar to this or the below sample would be ideal:

JSONObject jsonObject = loadJsonFromFile(...);

return new MessagePactBuilder()
    .expectsToReceive("a user created message")    
    .withContent(jsonObject)
    .toPact();
@github-actions
Copy link

👋 Thanks, this ticket has been added to the PactFlow team's backlog as PACT-757

@rholshausen
Copy link
Contributor

Looks like support for String data was implemented for #1619

@rholshausen
Copy link
Contributor

4.4.7 released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants