use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class RequestCycleListenerDetachOrderTest method pageDetachedBeforeListener.
@Test
public void pageDetachedBeforeListener() {
List<Event> events = new ArrayList<Event>();
WicketTester tester = new WicketTester();
tester.getApplication().getRequestCycleListeners().add(new TestListener(events));
tester.startPage(new TestPage(events));
assertEquals(Event.PAGE_DETACHED, events.get(0));
assertEquals(Event.LISTENER_DETACHED, events.get(1));
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class HttpsMapperApplicationTest method switchHttpsToHttpWithCustomPorts.
@Test
public void switchHttpsToHttpWithCustomPorts() {
WicketTester tester = new WicketTester(new HttpsMapperApplication(123, 456));
tester.getRequest().setScheme("https");
tester.getRequest().setServerPort(443);
requestPage(tester, HttpPage.class);
assertEquals("http", tester.getLastRequest().getScheme());
assertEquals(123, tester.getLastRequest().getServerPort());
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class HttpsMapperApplicationTest method switchDefaultToHttpsWithDefaultPorts.
@Test
public void switchDefaultToHttpsWithDefaultPorts() {
WicketTester tester = new WicketTester(new HttpsMapperApplication());
requestPage(tester, HttpsPage.class);
assertEquals("https", tester.getLastRequest().getScheme());
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class HttpsMapperApplicationTest method switchDefaultToHttpsWithCustomPort.
@Test
public void switchDefaultToHttpsWithCustomPort() {
WicketTester tester = new WicketTester(new HttpsMapperApplication(123, 456));
requestPage(tester, HttpsPage.class);
assertEquals("https", tester.getLastRequest().getScheme());
assertEquals(456, tester.getLastRequest().getServerPort());
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class HttpsMapperApplicationTest method testProtocolSwitchForNextRequest.
@Test
public void testProtocolSwitchForNextRequest() {
WicketTester tester = new WicketTester(new HttpsMapperApplication());
requestPage(tester, HttpsPage.class);
assertEquals("https", tester.getLastRequest().getScheme());
assertEquals("https", tester.getRequest().getScheme());
}
Aggregations