Commit f2959d9899b4f1b57a054d5906898a222ee4ebc8
1 parent
ddbf5a14
Exists in
master
Adição de testes para verificar o funcionamento quando o authorizer não
é mais nulo no SecurityContext
Showing
1 changed file
with
9 additions
and
0 deletions
Show diff stats
impl/core/src/test/java/security/authorization/custom/CustomAuthorizerTest.java
@@ -82,6 +82,15 @@ public class CustomAuthorizerTest { | @@ -82,6 +82,15 @@ public class CustomAuthorizerTest { | ||
82 | Assert.assertTrue(context.hasRole("role")); | 82 | Assert.assertTrue(context.hasRole("role")); |
83 | } | 83 | } |
84 | 84 | ||
85 | + /** | ||
86 | + * Verify if when already exist an authorizer, the things keeps working fine. | ||
87 | + */ | ||
88 | + @Test | ||
89 | + public void hasPermitionAndHasRole(){ | ||
90 | + Assert.assertTrue(context.hasPermission("resource", "operation")); | ||
91 | + Assert.assertTrue(context.hasRole("role")); | ||
92 | + } | ||
93 | + | ||
85 | @Test | 94 | @Test |
86 | public void denyPermission(){ | 95 | public void denyPermission(){ |
87 | Assert.assertFalse(context.hasPermission("falseresource", "falseoperation")); | 96 | Assert.assertFalse(context.hasPermission("falseresource", "falseoperation")); |