You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by ma...@apache.org on 2017/12/01 09:19:31 UTC
deltaspike git commit: Fix SecurityBindingTest for remote
in-container testing.
Repository: deltaspike
Updated Branches:
refs/heads/master 2847590c4 -> 042b9cbb4
Fix SecurityBindingTest for remote in-container testing.
Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/042b9cbb
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/042b9cbb
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/042b9cbb
Branch: refs/heads/master
Commit: 042b9cbb4b1c5e8ab7685d0e52db85b730b223ac
Parents: 2847590
Author: Matej Novotny <ma...@apache.org>
Authored: Fri Dec 1 10:04:26 2017 +0100
Committer: Matej Novotny <ma...@apache.org>
Committed: Fri Dec 1 10:04:26 2017 +0100
----------------------------------------------------------------------
.../securitybinding/SecurityBindingTest.java | 26 +++++++++++++++-----
1 file changed, 20 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltaspike/blob/042b9cbb/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/securitybinding/SecurityBindingTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/securitybinding/SecurityBindingTest.java b/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/securitybinding/SecurityBindingTest.java
index 7ffd3ad..bf2f0a1 100644
--- a/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/securitybinding/SecurityBindingTest.java
+++ b/deltaspike/modules/security/impl/src/test/java/org/apache/deltaspike/test/security/impl/authorization/securitybinding/SecurityBindingTest.java
@@ -59,18 +59,28 @@ public class SecurityBindingTest
Assert.assertEquals("allfine", testBean.someFineMethodFromParent());
}
- @Test(expected = AccessDeniedException.class)
+ @Test
public void simpleInterceptorTestDenied()
{
SecuredBean1 testBean = BeanProvider.getContextualReference(SecuredBean1.class, false);
- testBean.getBlockedResult();
+ try {
+ testBean.getBlockedResult();
+ Assert.fail();
+ } catch (AccessDeniedException e) {
+ //expected
+ }
}
- @Test(expected = AccessDeniedException.class)
+ @Test
public void simpleInterceptorTestParentDenied()
{
SecuredBean1 testBean = BeanProvider.getContextualReference(SecuredBean1.class, false);
- testBean.someBlockedMethodFromParent();
+ try {
+ testBean.someBlockedMethodFromParent();
+ Assert.fail();
+ } catch (AccessDeniedException e) {
+ //expected
+ }
}
@@ -81,10 +91,14 @@ public class SecurityBindingTest
Assert.assertEquals("result", testBean.getResult());
}
- @Test(expected = AccessDeniedException.class)
+ @Test
public void simpleInterceptorTestOnMethodsDenied()
{
SecuredBean2 testBean = BeanProvider.getContextualReference(SecuredBean2.class, false);
- testBean.getBlockedResult();
+ try {
+ testBean.getBlockedResult();
+ } catch (AccessDeniedException e) {
+ //expected
+ }
}
}