I want to export all stub mappings and files to re...
# help
r
I want to export all stub mappings and files to remote wiremock instance hosted on AWS . I am able to access remote EC2 windows instance from local . Everything works fine using both java api and Admin api conecting to remote instance . By manually copying files and mappings to remote wiremock directories it works fine but i would liek to push the files using java API as mentioend in the documentation but not able to do so . Attaching screenshot for Project Structure on local where wiremock client talks to remote instance ERROR: Exception in thread "main" java.lang.RuntimeException: \wiremock-stuff\mappings does not exist at com.github.tomakehurst.wiremock.common.AbstractFileSource.assertExistsAndIsDirectory(AbstractFileSource.java:143) at com.github.tomakehurst.wiremock.common.AbstractFileSource.listFilesRecursively(AbstractFileSource.java:77) at com.github.tomakehurst.wiremock.standalone.RemoteMappingsLoader.load(RemoteMappingsLoader.java:48) at com.github.tomakehurst.wiremock.client.WireMock.loadMappingsFrom(WireMock.java:869) at com.github.tomakehurst.wiremock.client.WireMock.loadMappingsFrom(WireMock.java:864) at Master.main(Master.java:57)
b
I think you need to set the path to “src/main/resources/wiremock-stuff” in your code.
r
Yes i did the same . Infact mappings are working on local with same structure. I see this issue being faced by others but didn't got solution on the web yet
o
Most likely the current dir is different in your EC2 Windows host.
r
Does that mean i should have exactly same stucture on remote standalone instance ? Even the directory like D: drive
o
No, it is not needed. You just need to follow the documentation on the file structure if you want to load the configuration files from the disc.
Personally I do not recommend this approach, because it complicates testing and distribution. I would recommend packaging WireMock and its configs together as a single job file or Docker image
r
That is already working from disk but i am pushing the files here to remote instance instead of manaully copying it
From disk it works both on lcoal and remote just files i am not able to push from local to remote
o
Why don't you package everything as a JAR since you have a Maven project anyway?
r
let me try that