I have a web app which use Wicket Auth/Roles to login user and assign roles. (http://wicket.apache.org/learn/projects/authroles.html)
You can refer to this example too: http://www.wicket-library.com/wicket-examples-6.0.x/authentication3/
I have many web pages and I want to login in my application before testing my pages. My test page extends WebAppTestBase.
Here is my code for WebAppTestBase:
public class WebAppTestBase {
protected WicketTester wicketTester;
private MyAuthenticatedWebApplication myAuthenticatedWebApplication = new MyAuthenticatedWebApplication();
@Before
public void setUp() {
wicketTester = new WicketTester(myAuthenticatedWebApplication);
}
@After
public void tearDown() {
wicketTester.destroy();
}
}
So how I could setUp AuthenticatedWebSession to authenticate my user, so I'll be able to test the other page.
Regards,