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

The issues on the Provider State are not reported #1082

Closed
anddreiu opened this issue May 4, 2020 · 9 comments
Closed

The issues on the Provider State are not reported #1082

anddreiu opened this issue May 4, 2020 · 9 comments

Comments

@anddreiu
Copy link

anddreiu commented May 4, 2020

Because of the nature of my project, I am doing some actions (some API calls) in the Provider State so that I can run then the Provider tests. One thing that I've noticed is the fact that if something goes wrong in the Provider State (for example, the response of the API call is not the expected one), this is not reflected in the report. The interaction that would use that Provider State will not be executed, so the interaction will not present in the report and might be missed when checking the results.

Could it be flagged that the Provider State failed, so the interaction was not executed?

Thanks

@uglyog
Copy link
Member

uglyog commented May 21, 2020

How are you running the verification tests?

@anddreiu
Copy link
Author

I verify pact with JUnit 4 tests. So I'm running the verification tests using mvn clean test and I specify the test suite which contains the pact tests.

@uglyog
Copy link
Member

uglyog commented May 21, 2020

Do your provider state methods throw an exception when they fail?

@anddreiu
Copy link
Author

anddreiu commented May 26, 2020

Sorry for this late reply. In most of the cases the provider state methods throw an exception. In this case, the report will not contain that specific interaction. Is there a way to change this? If the provider state throw an exception, flag this out in the report.

@uglyog
Copy link
Member

uglyog commented May 28, 2020

Are you referring to the JSON or Markdown report, or on the standard output? Or are you referring to the JUnit test report?

@anddreiu
Copy link
Author

I am referring to the generated Pact reports: JSON and Markdown reports. If the provider state throw an exception, then the interactions itself is not run and won't be populated anything in the pact report.

@uglyog
Copy link
Member

uglyog commented May 30, 2020

Ok, good, that should be easy to fix.

uglyog pushed a commit that referenced this issue Jun 7, 2020
@uglyog
Copy link
Member

uglyog commented Jun 9, 2020

4.1.1 has been released

@anddreiu
Copy link
Author

Tested and confirmed that it works fine. Thanks!

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