Basic JUnit Test

classic Classic list List threaded Threaded
1 message Options
yka
Reply | Threaded
Open this post in threaded view
|

Basic JUnit Test

yka
Hi all,

Im working at a basic Unit Test that looks like this:

1. tester.assertRenderedPage(FirstPage.class);
2. FormTester formTester = tester.newFormTester("myForm");
3. formTester.submit("myButton");
4. tester.assertRenderedPage(SecondPage.class);


All lines work as expected. Only line 4 fails. I just want to verify a click on a button and after that a certain Page (SecondPage) should be rendered.

The test fails with: "junit.framework.AssertionFailedError: expected:<SecondPage> but was:<FirstPage>"
What did I wrong?

Cheers & Thanks in advance,
Y