You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2024-11-20T08:43:26.193+01:00 INFO 21004 --- [demo] [ main] c.w.s.i.WireMockServerCreator myapp : Looking for mocks in classpath /wiremock/myapp/mappings/myapp...
2024-11-20T08:43:26.194+01:00 INFO 21004 --- [demo] [ main] c.w.s.i.WireMockServerCreator myapp : Looking for mocks in classpath /wiremock/myapp/mappings... found
2024-11-20T08:43:26.195+01:00 INFO 21004 --- [demo] [ main] c.w.s.i.WireMockServerCreator myapp : Serving WireMock mappings from classpath resource: wiremock/myapp/mappings
2024-11-20T08:43:26.198+01:00 INFO 21004 --- [demo] [ main] c.w.s.i.WireMockServerCreator myapp : Configuring WireMockServer with name 'myapp' on HTTP port: 0 and HTTPS port: -1
2024-11-20T08:43:26.918+01:00 INFO 21004 --- [demo] [ main] c.w.s.i.WireMockServerCreator myapp : Started WireMockServer with name 'myapp':http://localhost:57265
2024-11-20T08:43:26.919+01:00 INFO 21004 --- [demo] [ main] org.wiremock.spring.internal.Store : Resolving store from context: demo
2024-11-20T08:43:26.919+01:00 INFO 21004 --- [demo] [ main] c.w.s.i.WireMockServerCreator myapp : Adding property 'wiremock.server.baseUrl=http://localhost:57265' with HTTP base URL to Spring application context
2024-11-20T08:43:26.921+01:00 INFO 21004 --- [demo] [ main] c.w.s.i.WireMockServerCreator myapp : Adding property 'wiremock.server.port=57265' with HTTP port to Spring application context
However, call to wiremock-url/test results in
2024-11-20T08:43:29.039+01:00 INFO 21004 --- [demo] [qtp971404566-58] WireMock myapp : Request received:
127.0.0.1 - GET /test
Accept-Encoding: [gzip]
User-Agent: [ReactorNetty/1.1.23]
Host: [localhost:57265]
Accept: [*/*]
WebTestClient-Request-Id: [1]
Matched response definition:
(no response definition configured)
Response:
HTTP/1.1 404
(no headers)
2024-11-20T08:43:29.041+01:00 ERROR 21004 --- [demo] [qtp971404566-58] WireMock myapp : No response could be served as there are no stub mappings in this WireMock instance.
But I totally agree that the behavior here is strange. With the logging:
2024-11-20T08:43:26.194+01:00 INFO 21004 --- [demo] [ main] c.w.s.i.WireMockServerCreator myapp : Looking for mocks in classpath /wiremock/myapp/mappings... found
Now it just checks to see if the resource exsits, not if it is a WireMock mappings root folder.
Proposal
I am migrating from wiremock-spring-boot 2.x to 3.x.
Our mappings are located as specified by previous wiremock-spring-boot
src/main/resources/wiremock/wiremock-server-name/mappings
Content of the mapping file
According to changelog, I should use
filesUnderClasspath
as a replacement for 2.xstubLocation
Used annotations for for 2.x (implicitly sets
stubLocation
towiremock/myapp/mappings
)Used annotations for 3.x
Log output when starting wiremock with 3.x
However, call to
wiremock-url
/test results inWith previous version, it results in
Reproduction steps
I have set up a reproducer at https://github.com/ZIRAKrezovic/wiremock-spring-reproducer
There are two tests, one for 2.x and one for 3.x.
References
No response
The text was updated successfully, but these errors were encountered: