Skip to content

Commit

Permalink
[SHIRO-735] Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fpapon committed Jan 20, 2020
1 parent 5799afe commit 93142c5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
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);
}
}
Original file line number Diff line number Diff line change
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 93142c5

Please sign in to comment.