Skip to content

Commit

Permalink
Merge pull request #196 from fpapon/ASYNC_TEST
Browse files Browse the repository at this point in the history
[SHIRO-735] Add tests
  • Loading branch information
fpapon committed Jan 20, 2020
2 parents 5799afe + 93142c5 commit 4329f2a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Expand Up @@ -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 {
Expand All @@ -34,4 +36,12 @@ public class HelloResource {
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);
}
}
Expand Up @@ -36,6 +36,16 @@ public class ContainerIntegrationIT extends AbstractContainerIT {
.body(equalTo("Hello!"))
}

@Test
void testNoAuthResourceAsync() {

get(getBaseUri() + "say/async")
.then()
.assertThat()
.statusCode(is(200)).and()
.body(equalTo("Hello!"))
}

@Test
void testSecuredRequiresAuthentication() {

Expand Down

0 comments on commit 4329f2a

Please sign in to comment.