Thanks Pieter,

right in place i found the same solution :-).

Cause of our problem is that creation of WicketTester is not following a (maybe common-base) wicket rule: "Let the user override defaults by providing protected creation methods" e.g. newRequest().

All is done in MockWebApplication Constructor by using new Constructors for the MockHttpServletRequest. A second barrier is that the MockHttpServletRequest only provides default initialization of header attributes by usage of setDefaultHeaders which is private. Another way of providing locales in http headers would be if MockHttpServletRequest.addHeader(String, String) would exchange values or even better provide a setHeader(String, String) which is implemented that way. But there is still the problem with unaccessible instance creation of requests.

So the solution for me would be:
1. add method to MockWebApplication
protected MockHttpServletRequest newMockHttpServletRequest(Application application, ServletSession servletSession, ServletContext context) {
 return new MockHttpServletRequest(application, servletSession, context);
}
2. call new Method in Constructor
servletRequest = newMockHttpServletRequest(this.application, servletSession, context);
3. make setDefaultHeaders() in MockHttpServletRequest protected.

But the third change could have drawbacks i don't see now :-).

Cheers
Per

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to