Merge pull request #196 from fpapon/ASYNC_TEST

[SHIRO-735] Add tests
diff --git a/samples/jaxrs/src/main/java/org/apache/shiro/samples/jaxrs/resources/HelloResource.java b/samples/jaxrs/src/main/java/org/apache/shiro/samples/jaxrs/resources/HelloResource.java
index 400f503..6ba4d64 100644
--- a/samples/jaxrs/src/main/java/org/apache/shiro/samples/jaxrs/resources/HelloResource.java
+++ b/samples/jaxrs/src/main/java/org/apache/shiro/samples/jaxrs/resources/HelloResource.java
@@ -24,6 +24,8 @@
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
+import javax.ws.rs.container.AsyncResponse;
+import javax.ws.rs.container.Suspended;
 
 @Path("say")
 public class HelloResource {
@@ -34,4 +36,12 @@
     public String saySomething(@QueryParam("words") @DefaultValue("Hello!") String words) {
         return words;
     }
+
+    @Produces({"application/json","plain/text"})
+    @GET
+    @Path("async")
+    public void saySomethingAsync(@QueryParam("words") @DefaultValue("Hello!") String words,
+                                    @Suspended AsyncResponse asyncResponse) {
+        asyncResponse.resume(words);
+    }
 }
diff --git a/samples/jaxrs/src/test/groovy/org/apache/shiro/web/jaxrs/ContainerIntegrationIT.groovy b/samples/jaxrs/src/test/groovy/org/apache/shiro/web/jaxrs/ContainerIntegrationIT.groovy
index 84899d7..f55d37d 100644
--- a/samples/jaxrs/src/test/groovy/org/apache/shiro/web/jaxrs/ContainerIntegrationIT.groovy
+++ b/samples/jaxrs/src/test/groovy/org/apache/shiro/web/jaxrs/ContainerIntegrationIT.groovy
@@ -37,6 +37,16 @@
     }
 
     @Test
+    void testNoAuthResourceAsync() {
+
+        get(getBaseUri() + "say/async")
+                .then()
+                .assertThat()
+                .statusCode(is(200)).and()
+                .body(equalTo("Hello!"))
+    }
+
+    @Test
     void testSecuredRequiresAuthentication() {
 
         get(getBaseUri() + "secure/RequiresAuthentication")