Describe the bug
Spring Cloud Version: Hoxton.SR9
Maybe I get something wrong, but when I use the @AutoConfigureWireMock annotation and have a application.yml in place that looks like the following:
wiremock:
server:
port: 0
files:
- "classpath:/mocks"
The Wiremock server is not properly configured (the port is not set dynamically and also the stubs are not found). If I set those values directly within the Annotation like @AutoConfigureWireMock(port = 0, files = ["classpath:/mocks"]) then the configuration works and WireMock has a dynamic port and finds the stubs.
I'd have expected, that the @PropertyMapping("wiremock.server") on @AutoConfigureWireMock resolves the correct values. But that's apparently not the case.
Sample
Two tests are available, one for each described scenarios above.
https://github.com/janis91/wiremock-demo
Can you please answer all the required questions described in the issue template? For your convenience let me paste it here
Describe the bug
Please provide details of the problem, including the version of Spring Cloud that you
are using.Sample
If possible, please provide a test case or sample application that reproduces
the problem. This makes it much easier for us to diagnose the problem and to verify that
we have fixed it.
@marcingrzejszczak I have updated the description. Hope the sample helps as well.
I see what is going on, the AnnotationsPropertySource is taking precedence over the other profile specific application props (application-enabled.yml in the referenced sample). Therefore the @AutoConfigureWiremock default attribute values are always being used - unless overridden in the annotation itself.

I will continue looking more tomorrow. I want to compare/contrast this behavior with some of these similar @AutoConfigureXYZ annotations in Spring Boot.