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

Slightly refactor first two policy tests #145

Merged
merged 1 commit into from Mar 12, 2024
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
2 changes: 1 addition & 1 deletion tck/app-policy/pom.xml → tck/app-custom-policy/pom.xml
Expand Up @@ -27,7 +27,7 @@
<version>4.0.0-SNAPSHOT</version>
</parent>

<artifactId>app-mem-policy</artifactId>
<artifactId>app-custom-policy</artifactId>
<packaging>war</packaging>

<description>
Expand Down
Expand Up @@ -33,7 +33,7 @@
*
* <p>
* The role "foo" is required to access this Servlet. "bar" is a role assigned by the
* TestIdentityStore, "kaz" doesn't exist (but we should still be able to test for it).
* native identity store, "kaz" doesn't exist (but we should still be able to test for it).
*
*/
@WebServlet("/protectedServlet/*")
Expand Down
Expand Up @@ -33,7 +33,7 @@


@RunWith(Arquillian.class)
public class AppPolicyIT extends ArquillianBase {
public class AppCustomPolicyIT extends ArquillianBase {

@Deployment(testable = false)
public static Archive<?> createDeployment() {
Expand Down
4 changes: 2 additions & 2 deletions tck/app-policy2/pom.xml → tck/app-custom-policy2/pom.xml
Expand Up @@ -27,11 +27,11 @@
<version>4.0.0-SNAPSHOT</version>
</parent>

<artifactId>app-mem-policy2</artifactId>
<artifactId>app-custom-policy2</artifactId>
<packaging>war</packaging>

<description>
This tests executing a custom permission check before authentication takes place.
This tests executing a custom permission check afer authentication takes place.
</description>

<properties>
Expand Down
Expand Up @@ -32,8 +32,8 @@
* this caller is in any of the roles {foo, bar, kaz}
*
* <p>
* The role "kaz" is required to access this Servlet. "bar" is a role assigned by the
* TestIdentityStore.
* The role "kaz" is required to access this Servlet. "foo" and "bar" are roles assigned
* by the native identity store.
*
*/
@WebServlet("/protectedServlet/*")
Expand Down
Expand Up @@ -31,7 +31,7 @@


@RunWith(Arquillian.class)
public class AppPolicy2IT extends ArquillianBase {
public class AppCustomPolicy2IT extends ArquillianBase {

@Deployment(testable = false)
public static Archive<?> createDeployment() {
Expand All @@ -43,10 +43,10 @@ public static Archive<?> createDeployment() {

/**
* Normally authenticated for a request to the default path.
* Should not have access, since not in role "kaz"
* But should not have access, since not in role "kaz"
*/
@Test
public void testAuthenticated() {
public void testAuthenticatedWrongRole() {
DefaultCredentialsProvider credentialsProvider = new DefaultCredentialsProvider();
credentialsProvider.addCredentials("reza", "secret1");

Expand All @@ -58,7 +58,8 @@ public void testAuthenticated() {

/**
* Not authenticated on the default path.
* Should not have access, since not in the required role "kaz"
* Should not have access, since unauthenticated caller is of course
* not in the required role "kaz"
*/
@Test
public void testNotAuthenticated() {
Expand Down
4 changes: 2 additions & 2 deletions tck/pom.xml
Expand Up @@ -51,8 +51,8 @@
<module>common</module>

<!-- Setting a Jakarta Authorization policy -->
<module>app-policy</module>
<module>app-policy2</module>
<module>app-custom-policy</module>
<module>app-custom-policy2</module>
<module>app-policy3</module>
</modules>

Expand Down