Alex Arana
01/10/2024, 5:37 AMwiremock-cloud-contract-wiremock
to running as a Docker container using wiremock-testcontainers-java
. Everything has been smooth sailing except for some legacy Handlebars extensions which I worked around by enabling global response templating within the container instance. However, I noticed that WireMockContainer
does allow for the loading of external extensions using JAR file references.. has anyone been able to load Handlebars extension instances, as Spring beans, into WireMock docker?
In the past, we used spring-cloud-contract-wiremock
WireMockConfigurationCustomizer to load it programmatically like so:
// handlebarsHelper instance is injected by Spring while refreshing the ApplicationContext
@Bean
fun wireMockConfigurationCustomizer(
handlebarsHelper: Helper<Map<String, Any>>
) = WireMockConfigurationCustomizer { configuration ->
configuration.extensions(
ResponseTemplateTransformer(false, "helper-name", handlebarsHelper)
)
}
Oleg Nenashev
01/22/2024, 6:02 PM