List of usage examples for org.apache.wicket.request.http.flow AbortWithHttpErrorCodeException getErrorCode
public int getErrorCode()
From source file:fiftyfive.wicket.util.ParameterSpecTest.java
License:Apache License
/** * Asserts that badly formatted page parameter value causes an abort * with 404./* w w w . j a v a2 s .c om*/ */ @Test public void testParseParameters_badformat404() { ParameterSpec builder = new ParameterSpec<TestBean>(TestPage.class, "id", "name"); TestBean bean = new TestBean(); PageParameters params = new PageParameters(); params.set("id", "notparseableaslong"); try { builder.parseParameters(params, bean); Assert.fail("AbortWithHttpErrorCodeException was not thrown."); } catch (AbortWithHttpErrorCodeException awhece) { Assert.assertEquals(404, awhece.getErrorCode()); } }