Willem-Jan van Dun
06/26/2024, 9:16 AM@Bean(initMethod = "start", destroyMethod = "stop")
public WireMockServer wiremockStubServer(WireMockConfigProperties properties) {
Options options = createOptions(properties);
return new WireMockServer(options);
}
public static Options createOptions(WireMockConfigProperties properties) {
final String fileBaseDir = properties.files();
return options()
.port(properties.defaultPort()) // 8000
.usingFilesUnderClasspath(fileBaseDir) // "BOOT-INF/classes/wiremock/responses"
.mappingSource(new JsonFileMappingsSource(new ClasspathFileSource(properties.mappings()))); // "BOOT-INF/classes/wiremock/mappings"
}
And the files are indeed available in these locations.
"request": {
"method": "GET",
"urlPath": "/someResource/TEST0001/whatever
},
Lee Turner
06/26/2024, 10:00 AMWillem-Jan van Dun
06/26/2024, 11:31 AMLee Turner
06/26/2024, 11:38 AMWillem-Jan van Dun
06/26/2024, 11:52 AM