Proposal
In Wiremock 2.35 I have the following external file;
file.json
[
{
"id": "theID",
"time": {{now offset='2 hours' format='epoch'}}
}
]
with the following code;
WireMockConfiguration config = new WireMockConfiguration().extensions(new ResponseTemplateTransformer(true))
.port(9090).fileSource(new ClasspathFileSource("src/test/resources/jsonfiles/"));
wireMockServer = new WireMockServer(config);
in 3.0 the code change to this;
WireMockConfiguration config = new WireMockConfiguration();
FileSource fs = new ClasspathFileSource("src/test/resources/jsonfiles/");
config = config.port(9090).fileSource(fs)
.extensions(new ResponseTemplateTransformer(TemplateEngine.defaultTemplateEngine(), true, fs,
Collections.emptyList()));
wireMockServer = new WireMockServer(config);
in the json returned by wiremock, the {{now offset='2 hours' format='epoch'}} is not replaced thus leading to wrong json format + data. I must say I also find it odd api wise to pass the FileSource to both the config and the ResponseTemplateEngine.
Reproduction steps
have wiremock returning a classpathfilesource like the above and see the template not being replaced.
References
Relates to; wiremock/wiremock.org#157
Proposal
In Wiremock 2.35 I have the following external file;
file.json
with the following code;
in 3.0 the code change to this;
in the json returned by wiremock, the
{{now offset='2 hours' format='epoch'}}is not replaced thus leading to wrong json format + data. I must say I also find it odd api wise to pass the FileSource to both the config and the ResponseTemplateEngine.Reproduction steps
have wiremock returning a classpathfilesource like the above and see the template not being replaced.
References
Relates to; wiremock/wiremock.org#157