Closed wegax closed 10 years ago
I have extended the MockServerClient with additional constructor which allows to provide full path to the application (i.e.: http://localhost:8080/mockserver). Unfortunatelly this has lead to problem with RequestUri in MockServerServlet which contains additionaly applicaiton context (for example requestUri for Reset is as follow: /mockserver/reset). The proposition for solving the issue is to cutoff httpServletRequest.getContextPath() from RequestUri in doPut and handlePOSTorGet.
Thanks this is a good point I missed as I typically use Jetty without any context path.
I'll look into this in the next day or two and add some tests to make sure this is covered in future.
I'll let you know once it has been committed and added to a SNAPSHOT.
I have committed a solution for this, now the MockServerClient has an additional context path parameter. In addition all matching, etc ignores the context path. As a result the context path can be changed and only the constructor call needs to be updated, all expectations should not need to change at all.
I'm closing this issue but let me know if you see anything else.
Thanks,
James
I have checked and it work as expected.
Marcin
2014/1/5 James D Bloom notifications@github.com
Closed #3 https://github.com/jamesdbloom/mockserver/issues/3.
— Reply to this email directly or view it on GitHubhttps://github.com/jamesdbloom/mockserver/issues/3 .
For example I have deployed mockserver.war on apache tomcat. It's address is: http://localhost:8080/mockserver. Using MockServerClient I am unable to connect with the application becuase MockServerClient constructor only allows to provide HOSTNAME and PORT.