Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SHIRO-735] Add tests #196

Merged
merged 1 commit into from Jan 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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