-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Ensure that eager security handling works in native mode
- Loading branch information
Showing
7 changed files
with
114 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
integration-tests/oidc/src/main/java/io/quarkus/it/keycloak/HelloResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package io.quarkus.it.keycloak; | ||
|
||
public class HelloResource extends HelloResourceBase implements IHelloResource { | ||
} |
11 changes: 11 additions & 0 deletions
11
integration-tests/oidc/src/main/java/io/quarkus/it/keycloak/HelloResourceBase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package io.quarkus.it.keycloak; | ||
|
||
import javax.annotation.security.RolesAllowed; | ||
|
||
@RolesAllowed("user") | ||
public class HelloResourceBase { | ||
|
||
public String hello() { | ||
return "hello"; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
integration-tests/oidc/src/main/java/io/quarkus/it/keycloak/IHelloResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.quarkus.it.keycloak; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
|
||
@Path("/hello") | ||
public interface IHelloResource { | ||
|
||
@GET | ||
@Produces(MediaType.TEXT_PLAIN) | ||
String hello(); | ||
} |
7 changes: 7 additions & 0 deletions
7
integration-tests/oidc/src/test/java/io/quarkus/it/keycloak/HelloResourceIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package io.quarkus.it.keycloak; | ||
|
||
import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
|
||
@QuarkusIntegrationTest | ||
public class HelloResourceIT extends HelloResourceTest { | ||
} |
18 changes: 18 additions & 0 deletions
18
integration-tests/oidc/src/test/java/io/quarkus/it/keycloak/HelloResourceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.quarkus.it.keycloak; | ||
|
||
import static io.restassured.RestAssured.when; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import io.quarkus.test.junit.QuarkusTest; | ||
|
||
@QuarkusTest | ||
public class HelloResourceTest { | ||
|
||
@Test | ||
public void testHelloEndpoint() { | ||
when().get("/hello") | ||
.then() | ||
.statusCode(401); | ||
} | ||
} |