Hi,

I'd like to unit test a "setResponsePage" from inside one of my panels using
the wicket tester.

I have an EditPanel, which on submit of its form calls
setResponsePage(SomeComplexPage.class, someParameters)

I only want to test the Panel's behaviour (ie, does the form behave
correctly, are the appropriate services called).

The SomeComplexPage has a lot of bean dependencies which are injected via
@SpringBean.  I dont want to mock these in.  I'm not trying to test
SomeComplexPage - it will have its own unit tests.

I've implemented bits of
http://www.nabble.com/Using-the-WicketTester-WITHOUT-rendering-a-response-on-submit-td13737447.html#a13737447
which seems very close to what I need, however the page is still being
instantiated from the PageFactory.

Something like

        formTester.setValue("name", testPerson.getName());
        MyApplication.suspendResponding();
        formTester.submit("Save");
        wicketTester.assertRenderedPage(SomeComplexPage.class);

is what I'm after - without the constructor of SomeComplexPage being called.

Is there a way of doing this?
-- 
View this message in context: 
http://www.nabble.com/How-to-test-setResponsePage-tp16802302p16802302.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to