[seam-issues] [JBoss JIRA] Created: (SEAMSECURITY-104) In user tests it should be easy to switch Identity for a single test method (or test class): @TestAsIdentity(username = "...")

Geoffrey De Smet (JIRA) jira-events at lists.jboss.org
Thu Sep 15 05:12:26 EDT 2011


In user tests it should be easy to switch Identity for a single test method (or test class): @TestAsIdentity(username = "...")
------------------------------------------------------------------------------------------------------------------------------

                 Key: SEAMSECURITY-104
                 URL: https://issues.jboss.org/browse/SEAMSECURITY-104
             Project: Seam Security
          Issue Type: Feature Request
            Reporter: Geoffrey De Smet


Writing tests for different users, different roles and/or different groups should be easy.

Ideally, we want something like this:
{code}
@Test @TestAsIdentity("admin")
public void testAdminActionByAdmin() {
   adminService.doSomething();
}


@Test(expectedException = AuthorizationException.class) @TestAsIdentity("john")
public void testAdminActionByMember() {
   adminService.doSomething();
}
{code}

Create a seam-security-junit module on which a user project can depend on with scope=test to use that @TestAsIdentity and other annotations.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list