@@ -28,7 +28,8 @@ public static WebArchive getDeployment()
2828 .addAsLibrary (RewriteAnnotationTest .getRewriteCdiArchive ())
2929 .addClass (QueryParameterBean .class )
3030 .addAsWebResource (new StringAsset (
31- "Log: [${queryParameterBean.value}]" ),
31+ "Log: [${queryParameterBean.value}]\n "
32+ + "IsNull: [${queryParameterBean.value == null}]" ),
3233 "query.jsp" );
3334 }
3435
@@ -38,6 +39,7 @@ public void testQueryParameter() throws Exception
3839 HttpAction <HttpGet > action = get ("/query?q=foo" );
3940 assertEquals (200 , action .getStatusCode ());
4041 assertThat (action .getResponseContent (), Matchers .containsString ("Log: [foo]" ));
42+ assertThat (action .getResponseContent (), Matchers .containsString ("IsNull: [false]" ));
4143 }
4244
4345 @ Test
@@ -46,6 +48,16 @@ public void shouldFindCorrectQueryParameterIfOthersExist() throws Exception
4648 HttpAction <HttpGet > action = get ("/query?a=b&q=foo&c=d" );
4749 assertEquals (200 , action .getStatusCode ());
4850 assertThat (action .getResponseContent (), Matchers .containsString ("Log: [foo]" ));
51+ assertThat (action .getResponseContent (), Matchers .containsString ("IsNull: [false]" ));
52+ }
53+
54+ @ Test
55+ public void shouldSupportMissingQueryParameter () throws Exception
56+ {
57+ HttpAction <HttpGet > action = get ("/query" );
58+ assertEquals (200 , action .getStatusCode ());
59+ assertThat (action .getResponseContent (), Matchers .containsString ("Log: []" ));
60+ assertThat (action .getResponseContent (), Matchers .containsString ("IsNull: [true]" ));
4961 }
5062
5163}
0 commit comments