you can create your own subclass of mockhttpservletrequest and return
whatever you want. hooking it into wickettester should not be that
bad... if it is we can see if we can make it easier.

-igor

On Wed, Nov 4, 2009 at 8:27 AM, Ted Vinke <[email protected]> wrote:
> Hi!
>
> Seems a bit dumb I can't seem to get the following working. In my
> application I have to so something special based on the domain the app is
> running on. I ask for that domain in the following manner:
>
>   String serverName =
> getWebRequestCycle().getWebRequest().getHttpServletRequest().getServerName();
>   // serverName is e.g. 'www.somedomain.com'
>
> The problem: when testing in the Wicket tester serverName results in
> 'localhost'.
>
> How can I set / mock
> getWebRequestCycle().getWebRequest().getHttpServletRequest().getServerName()
> to return a preset value, such as 'www.somedomain.com',  when accessing my
> page in my unit test?
>
> Any tips or hints to examples are greatly appreciated!!
>
> Kind regards,
> Ted
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

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

Reply via email to