wiremock / wiremock-spring-boot

WireMock Spring Boot drastically simplifies testing HTTP clients in Spring Boot & Junit 5 based integration tests.
MIT License
314 stars 16 forks source link

Support wiremock configuration options #16

Closed VladimirMorozov closed 1 year ago

VladimirMorozov commented 1 year ago

Currently an instance of WireMockServer is created which you cannot configure further. Annotations don't provide a way to configure options too. What if I want to change transfer encoding or gzip options?

maciejwalkowiak commented 1 year ago

Yes, this is not supported at the moment, but support can be added. Do you have suggestions how it can be implemented?

VladimirMorozov commented 1 year ago

Not sure. The most obvious idea is to mirror the options as an annotation. Or maybe create something very similar to WireMockExtension, but allowing to additionally specify a spring property?

maciejwalkowiak commented 1 year ago

@VladimirMorozov take a look at #18. It adds option to customize WireMockServer on @ConfigureWireMock. I think this could be extended to accept customizers on @EnableWireMock or even global level through some properties file, but both would require a bit more work.

VladimirMorozov commented 1 year ago

Thank you! Maybe this requires too much code to change one option, but I think it's good enough and doesn't restrict you in how and what you want to change.

maciejwalkowiak commented 1 year ago

@VladimirMorozov we can add more options to annotation too. I just don't want to overload it with everything that's possible and keep it with ones that are used most often. Customizer on the other hand does require a bit of code indeed but gives ultimate flexibility.

Which options do you believe should be added on the annotation level?