Hi, I need help fixing an integration tests writte...
# help
f
Hi, I need help fixing an integration tests written in
Java
that stopped working after upgrading the version from
3.0.4
to
3.4.2
issue:
My test is failing because I have a timeout set to 3" and my API are not receiving any response from WireMock within that timeframe. This is how I configured the WireMockServer instance:
Copy code
final WireMockConfiguration options = new WireMockConfiguration().dynamicPort();
this.wireMockServer = new WireMockServer(options);
this.wireMockServer.start();
And here is my stub:
Copy code
this.wireMockServer.stubFor(get(new UrlPathPattern(containing(**URL**), true))
        .inScenario("test scenario")
        .whenScenarioStateIs(STARTED)
        .willSetStateTo("test scenario 1")
        .withHeader(AUTHORIZATION, equalTo("Bearer " + token))
        .willReturn(aResponse()
                .withBody(mapper.serialize(response).orElseThrow())
                .withHeader(CONTENT_TYPE, APPLICATION_JSON)));
I tried to progressively upgrade the version from
3.0.4
and I'm starting to see the issue from
3.3.1
(same issue with
3.3.0
but I'm not using it since it's been marked as discarded). I tried to look at the release note but I couldn't find anything to the issue I'm having. I would really appreciate anyones help 🙏 🙂
t
Does the test pass if you raise the timeout, or is the response not arriving at all?
f
The response is not arriving at all
t
I can’t see any obvious reason from the code you’ve shared. Does anything useful get logged if you enable verbose mode?
f
Nope ☹️
It's only logging
Verbose logging enabled
Nothing else, like it never receive the request
t
Can you create a minimal reproducer project?
f
I've also tried to hit the
__admin/mappings
endpoint via Postman, but I get
Error: socket hang up
in return.
t
That suggests either it’s not starting at all or something in your surrounding infra has changed
Are you using http or https?
f
Is there a way to check if the WireMockServer is actually up and running?
t
The way you’ve just tried is as good as any
f
Are you using http or https?
http
t
Are you running it from within Java or standalone?
f
within Java
t
🤔
Wondering whether there’s been a transitive dependency change somewhere that’s broken it i.e. something in your project is supplying a different version to the one WireMock expects and is breaking it
Might be worth temporarily switching to the standalone artifact in your build and seeing if that makes any difference
f
Wondering whether there’s been a transitive dependency
That was the issue, the
http2-server
version was set to a previous (11.0.16) one that perhaps was preventing the wiremock server to startup properly.
Thank you so much for your help 🙏 🙌
👍 1