Verifies if the container manages the security roles defined by annotation,
as well as verifies the methods in the session context related with security.
The bean used during the tests is stateless. The chapter verified is the 17.
author: Gisele Pinheiro Souza author: Eduardo Studzinski Estima de Castro
Method Summary
public void
setup() Creates the stateful bean used during the tests.
testIsCallerInRoleCorrect() Verifies if the isCallerInRole returns true when the correct role name is
used.
public void
testIsCallerInRoleDeprecated() Verifies if the correct exception(Runtime or subclass) is thrown when the
deprecated method getCallerInRole(Identity identity) is called.
public void
testIsCallerInRoleIncorrect() Verifies if the isCallerInRole returns false when the incorrect role name is
used.
Verifies if the correct exception(Runtime or subclass) is thrown when the deprecated method getCallerIdentity is called.
testGetCallerPrincipalDifferentCaller
public void testGetCallerPrincipalDifferentCaller()(Code)
Verifies if the annotation RunAs does not change the current caller for a
class the has the RunAs(bean1). The bean1 call a method in other bean
that returns the caller principal, this caller must be different of the
current bean1 caller.
testGetCallerPrincipalSameCaller
public void testGetCallerPrincipalSameCaller()(Code)
Verifies if the caller is propagated among the beans. The bean1(that has
not the annotation RunAs) call the bean2, the both caller principal must
be the same.
Verifies if the isCallerInRole returns true when the correct role name is
used. The bean1 has the annotation RunAs(role1) and call the bean2 that
verifies if the isCallerInRoleMethod(role1) returns true.
Verifies if the isCallerInRole returns false when the incorrect role name is
used. The bean1 has the annotation RunAs(role1) and call the bean2 that
verifies if the isCallerInRoleMethod(roleX) returns false.