-
1. Re: Test Secure EJB with Arquillian
jaikiran Nov 11, 2011 5:19 AM (in response to lpham1)Can you please post the exact bean code? Also, do you have any ejb-jar.xml file?
-
2. Re: Test Secure EJB with Arquillian
lpham1 Nov 15, 2011 7:44 PM (in response to jaikiran)Hi Jaikiran,
Code is as follow:
@Stateless
@SecurityDomain("my-security-domain")
@DeclareRoles({ "Admin", "Guest" })
//By default, allow no one access, we'll enable access at the method level
@RolesAllowed({})
public class SecureServiceBean implements ServiceBeanLocal
{
//instance variables omitted
@RolesAllowed({ "Admin" })
@TransactionAttribute(TransactionAttributeType.REQUIRED)
@Override
public MyDTO save(MyDTO dtoObject)
{
//omitted
//invocation to this method failed in the Integration Test ("Insufficient method permission")
}
@PermitAll @Override
public MyDTO load(long id)
{
//invocation to this method works in the Integration Test
}
}
I don't have ejb-jar.xml because I used annotations (please see the above code).
Thanks for your help.
-- Linh
-
3. Re: Test Secure EJB with Arquillian
lpham1 Feb 7, 2012 10:40 PM (in response to lpham1)I have found the <possible> solution and documented here:
http://stackoverflow.com/questions/8073643/use-arquillian-to-test-secure-ejb/9187517
Thanks.
-- Linh