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

Is RestPactRunner compatible with V4Pact? #1692

Closed
metteo opened this issue May 15, 2023 · 4 comments
Closed

Is RestPactRunner compatible with V4Pact? #1692

metteo opened this issue May 15, 2023 · 4 comments

Comments

@metteo
Copy link

metteo commented May 15, 2023

Hi

Asking here instead of SO because it seems to be a bug / omission.

I have a situation where consumer is publishing a V4Pact in pactflow.
Provider test is fetching it correctly (under debugger) but then PactRestRunner filters it out because it's not an instance of RequestResponsePact...

I'm wondering if that filtering expression should include || pact.isRequestReponsePact() and some conversion logic (pact.asRequestResponsePact()) down the line.

I'm using pact-jvm 4.3.x which is marked as unsupported, but PactRestRunner was not touched since 2020..

@metteo
Copy link
Author

metteo commented May 16, 2023

I have overridden filtering method and included above condition / conversion logic. I can confirm it works for executing the tests. Not sure about publishing the verifications, will report tomorrow.

@metteo
Copy link
Author

metteo commented May 17, 2023

So I identified another problem. During conversion to RequestResponsePact source field is initialized with a default UnknownPactSource instead of the one from V4Pact which is BrokerUrlSource. This prevents publishing of verifications.

@rholshausen
Copy link
Contributor

Support was only added for JUnit 5. None of the JUnit 4 code has been touched.

@metteo
Copy link
Author

metteo commented May 24, 2023

@rholshausen thanks for the reply. It confirmed my suspicions.

As I mentioned above I was able to make minor modifications on top of SpringRestPactRunner to enable support of V4 pacts. I tested the whole provider part so: fetching from broker, running the tests and publishing the verifications back (but only for RequestResponsePact).

I'm not sure what your plans are regarding junit4 and V4Pact. Is the combination unsupported for the provider side? Are there plans to implement it but at a later stage?

I'm asking because I have a project with some hard to untangle dependencies (spring, camel, junit4 based integration test) where switching to junit5 is planned but will take time.

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