Re: Unit tests that use wicket's session and spring session

2014-09-02 Thread lucast
Hi Marios, Have you had a look at the on-line wicket guide? https://wicket.apache.org/guide/guide/testingspring.html That is a really good chapter for setting up Wicket Spring testing. I hope that helps, Lucas -- View this message in context:

Re: Unit tests that use wicket's session and spring session

2014-09-02 Thread mscoon
Thank you both for your answers. Recent versions of Spring have their own way of creating a mock servlet context and their own mock sessions and requests (MockHttpServletRequest) and those cannot be combined with wicket (at least I didn't find a way to do it), because if you go that route there

Unit tests that use wicket's session and spring session

2014-09-01 Thread mscoon
Hi all, Might I ask if there are any pointers to writing tests for wicket that can successfully access wicket's session (i.e. Session.get()) and spring's session (i.e. use session scoped beans either by autowiring or using the spring injector)? Thanks Marios

Re: Unit tests that use wicket's session and spring session

2014-09-01 Thread Martin Grigorov
Hi, WicketTester.getSession() returns the Wicket session. You can cast it to your specialization. Spring stores its session-scoped beans in as attributes in the http session. There is a dummy http session in WicketTester tests so everything should be fine. You don't need to do anything special