Forum Discussion

amirse's avatar
amirse
Contributor
6 years ago
Solved

Getting error 404 Not Found but expecting 200 when using mocking

Hi,
I have a GET step which uses the this URL "https://inter.comp.se/v1/state/${Properties1#agreement}/tree". Now when I run this in real environment the #agreement variable is replaced by a real value from my previous steps and in the end I get a JSON message back as a response from the server "{ "orgNumber":"123456-789", "orgName":"Company1"}". So far so good.
Now I would like to mock this step to avoid dependency on the server so I created a "Add to Virt" step on port 8082 (http://localhost:8082). The response for this virtual service uses Sequence Dispatch Style with:
Http Status Code = 200
Content = application/json
Message = { "orgNumber":"123456-789", "orgName":"Company1"}
However since I am not really sending this GET call to a real server I just use "http://localhost:8082", i.e. the "v1/state/${Properties1#agreement}/tree" is not there.
Then I start the virtual service and run this test step and where I expect status code 200 I get 404.
Any ideas why??

  • Hmm found the issue. Too many places where I changed the port number so I forgot to updated it at the right place. This works.

1 Reply

  • Hmm found the issue. Too many places where I changed the port number so I forgot to updated it at the right place. This works.