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

@Pact annotation with dynamic values #989

Closed
Yamuna-Rani opened this issue Dec 4, 2019 · 1 comment
Closed

@Pact annotation with dynamic values #989

Yamuna-Rani opened this issue Dec 4, 2019 · 1 comment

Comments

@Yamuna-Rani
Copy link

I want to pass the dynamic values to @Pact annotation from the property file.

@Pact(provider = "Profile_Provider", consumer = "Profile_Consumer")
public PactFragment createFragment(PactDslWithProvider builder) {
Map<String, String> headers = new HashMap<>();
headers.put("Content-Type", "application/json;charset=UTF-8");
return builder.uponReceiving("a request for
profile").path("/producers").method("GET").willRespondWith()
.headers(headers).status(200)
.body("[{"producerId":"119bbacd","firstName":"jomon","lastName":"varghese","email":"jomon@yahoomail.com"},{"producerId":"jkjk1jkjk2","firstName":"joy","lastName":"varghese","email":"joy@abcd.com"}]")
.toFragment();
}

Can you please help the same.

Thanks,
Yamuna

@uglyog
Copy link
Member

uglyog commented Jan 26, 2020

Version 4.0.5 has been released with this change

@uglyog uglyog closed this as completed Feb 22, 2020
uglyog pushed a commit that referenced this issue Apr 26, 2020
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

2 participants