Hi,

Since you use WicketTester I see no reason to mock the Session.
Just use ((MySession) tester.getSession()).getUserId()


On Mon, Apr 8, 2013 at 3:25 PM, madmax108 <[email protected]> wrote:

> Hi there,
> I'm using Wicket+Spring+Mockito for an application and am trying to work
> alongside a set of well defined test code.
>
> For a feature I'm working on, I need to get the userid of a given user,
> which is stored by Wicket in the user session, and need to test out the
> feature using WicketTester
>
> How do I go about this?
>
> I know that I need to mock the session, but no matter what I try, it keeps
> returning a null value returned by the mock. I'm using the
> when().thenReturn() method of mocking (but have tried with the doReturn as
> well)
>
> How do I go about this?
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-mock-Session-using-Mockito-for-a-Wicket-application-tp4657817.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Reply via email to