Skip to content

Conversation

@Jurigag
Copy link

@Jurigag Jurigag commented May 26, 2025

This adds a change to allow RequestPattern to be used instead of RequestPatternBuilder. Use case for it is quite obvious for example:

We first use Wiremock::sutbFor which returns StubMapping instance, with RequestPattern being there. Then we can simply access that request pattern and pass it to verify method directly.

@wslawski-printify
Copy link

@rowanhill Let me know what you think about it :)

@rowanhill
Copy link
Owner

Interesting. I'm a little reluctant to adopt this, though, as it's a departure from the WireMock Java API. Do you think there's any reason this pattern is needed in the PHP bindings but not in Java?

Also, if we did include this, I'd like to see some tests covering this use case.

@wslawski-printify
Copy link

Keep in mind that for exampleimportStubs method already accept builder on concrete ImportStub, so it's basically similar stuff for different methods, which kind of makes sense in some cases.

Surely, will provide a test with use case here, wasn't just sure what are yout thoughts about it. I had an use case where I would like to just use that request pattern already built later. Will provide tests later.

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

Successfully merging this pull request may close these issues.

3 participants