How to mock External Domain URL

381 views
Skip to first unread message

Muhil Rajaram

unread,
Mar 9, 2017, 12:36:17 AM3/9/17
to wiremock-user
Hi, 

    I am planning to use wiremock for post deployment tests. My App depends on other 2 apps with different domain

My App Domain : http://app.domain.com
Dependency App1 Domain : http://app1.dep.domain.com
Dependency App2 Domain : http://app2.dep.domain.com

Is there a way to return custom responses for the rest calls making to App1,App2 from my app? I noticed that wiremock only works for the rest calls with localhost domain.

Please confirm.

Thanks,
Muhil


Tom Akehurst

unread,
Mar 9, 2017, 4:11:01 AM3/9/17
to wiremock-user
WireMock doesn't have to be run on localhost. You can start it in standalone mode and run it on a server other than where your app under test is running.

Then you have two options:
1) start WireMock with --enable-browser-playing and set your app's proxy to point to it, or
2) configure the host and port for the API you are mocking in your app to point to where WireMock is running

Reply all
Reply to author
Forward
0 new messages