Description
The following test for internationalization doesn't work, as rendering the page will create a new session.
WicketTester tester = new WicketTester();
tester.getWicketSession().setLocale(Locale.FRENCH);
tester.startPage(HelloWorld.class);
tester.assertLabel("message", "Bonjour tout le monde!");
But setting up the response and request first works around recreating the session
WicketTester tester = new WicketTester();
tester.setupRequestAndResponse();
tester.getWicketSession().setLocale(Locale.FRENCH);
tester.startPage(HelloWorld.class);
tester.assertLabel("message", "Bonjour tout le monde!");