Hi,
First of all would like to Thanks WireMock team for amazing mock solution which is simple to use and integrate.
I had a specific issue. I am running WireMock Like below in my Junit Tests on my local machine. When WireMock starts it runs on 8089 port as below and I can browse the URL through the below link which is perfect.
https://localhost:8099/xx/xx/invoice/201628JP00006097
@Rule
public WireMockRule
wireMockRule = new WireMockRule(wireMockConfig().httpsPort(8089));
wireMockRule.stubFor(get(urlEqualTo("/xx/larxxs/invoice/201627JP00006087"))
.willReturn(aResponse().withHeader("Content-Type", "text/xml").withBodyFile("K000006087.xml")));
After hosting this mock on my local machine, I run some batch job on a remote UNIX Server. The batch job then tries to fetch this data from mock via https link and it used to work fine. Now there have been some changes on Remote UNIX Server or I am not sure what has changed overnight as the remote UNIX Machine is throwing error while trying to get data from WireMock. Though the ping is working from my machine to remove UNIX Machine and vice versa and I am able to get data via browser on my localhost.
2016-08-03 17:31:50.101 ERROR 19483 --- [main] .w.s.l.s.b.t.OldLarsRestInvoiceGenerator : Exception while getting invoice data from Cybill rest service
org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://10.10.34.238:8089/xx/xx/invoice/201627JP00006087": Connection timed out; nested exception is java.net.ConnectException: Connection timed out
I wanted to ask, if we can run WireMock programmatically from Junit on Remote UNIX Machine and how we can do that. Like in @Rule I mentioned it to run on port 8089. Can I mention the host also here.
I saw that we can install Jar file on remote server and then run it, but is there a way to do it programmatically and start the wireMock on remote server instead.
@Rule
public WireMockRule wireMockRule = new WireMockRule(wireMockConfig()
.httpsPort(8089)
.host(myUNIXSERVER));
Thanks for help!!