Uploaded image for project: 'Seam Security'
  1. Seam Security
  2. SEAMSECURITY-104

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

    Details

    • Type: Feature Request
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

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

      Ideally, we want something like this:

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

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

        Gliffy Diagrams

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              ge0ffrey Geoffrey De Smet
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Development