I hope this helps . Using your provided code, I first had to handle the java.net.ConnectionException that was being thrown. Your test's url needs the port on localhost. sendGet("http://localhost:8089/my/resource/121") After that, I think that the reason you're getting a 404 is that your regex does not match your test url.
wish help you to fix your issue I found solution for this. So, basically we need create a folder called "mappings" (exact name) under the directory identified by "testResource" variable. So in above code example, the mapping.json file will be stored at location: "MockApp/resources/testconfig/mappings/mapping.json". Once this, is done, it will print the following output. As can be seen in the logs, "Stub mapping size is 1". This will be printed once you add the following line in the code.