Use Case / Motivation
During our Spring Boot 4 upgrade we migrated from Spring Cloud Contract WireMock to WireMock Spring Boot due to the removal of @AutoconfigureWireMock. We simply replaced the annotation everywhere with @EnableWireMock. However, we ran into an issue with our Cucumber tests. Due to those tests using the custom JUnit Cucumber engine instead of the JUnit Jupiter engine, the WireMockSpringJunitExtension is never loaded.
This was a bit confusing since it fails silently and only partially. The WireMock server is started correctly, since those are started through the Spring Test framework in WireMockContextCustomizer. Just the default WireMock client is never configured nor are the servers reset between tests, since that is handled by the extension.
Proposed Solution
Would it be an option to also provide (or migrate) the functionality of the extension using the Spring Test framework, for example a TestExecutionListener? I've build a hacky internal implementation now that somewhat reproduces the behaviour of the extension, but as it relies on internal WireMock Spring Boot functionality it is quite fragile.
Use Case / Motivation
During our Spring Boot 4 upgrade we migrated from Spring Cloud Contract WireMock to WireMock Spring Boot due to the removal of @AutoconfigureWireMock. We simply replaced the annotation everywhere with @EnableWireMock. However, we ran into an issue with our Cucumber tests. Due to those tests using the custom JUnit Cucumber engine instead of the JUnit Jupiter engine, the WireMockSpringJunitExtension is never loaded.
This was a bit confusing since it fails silently and only partially. The WireMock server is started correctly, since those are started through the Spring Test framework in WireMockContextCustomizer. Just the default WireMock client is never configured nor are the servers reset between tests, since that is handled by the extension.
Proposed Solution
Would it be an option to also provide (or migrate) the functionality of the extension using the Spring Test framework, for example a TestExecutionListener? I've build a hacky internal implementation now that somewhat reproduces the behaviour of the extension, but as it relies on internal WireMock Spring Boot functionality it is quite fragile.