Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension of MockServerClient to point to given endpoint #3

Closed
wegax opened this issue Jan 3, 2014 · 4 comments
Closed

Extension of MockServerClient to point to given endpoint #3

wegax opened this issue Jan 3, 2014 · 4 comments
Assignees
Milestone

Comments

@wegax
Copy link

wegax commented Jan 3, 2014

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.

@wegax
Copy link
Author

wegax commented Jan 3, 2014

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.

@ghost ghost assigned jamesdbloom Jan 3, 2014
@jamesdbloom
Copy link
Collaborator

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.

@jamesdbloom
Copy link
Collaborator

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

@wegax
Copy link
Author

wegax commented Jan 6, 2014

I have checked and it work as expected.

Marcin

2014/1/5 James D Bloom notifications@github.com

Closed #3 #3.


Reply to this email directly or view it on GitHubhttps://github.com//issues/3
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants