[jboss-jira] [JBoss JIRA] (WFLY-5742) Fix test coverage for @RunAs in servlets

Kabir Khan (JIRA) issues at jboss.org
Wed Dec 6 12:27:18 EST 2017


     [ https://issues.jboss.org/browse/WFLY-5742?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kabir Khan updated WFLY-5742:
-----------------------------
    Fix Version/s: 11.0.0.Final


I am bulk closing old issues that were resolved with no fix version. There are quite many of these so I am not checking the history properly. From the lastModified date of this issue it looks like it was done for 11.0.0.Final (I am not caring about alpha/beta etc. for this exercise). If that is incorrect please adjust as needed.

> Fix test coverage for @RunAs in servlets
> ----------------------------------------
>
>                 Key: WFLY-5742
>                 URL: https://issues.jboss.org/browse/WFLY-5742
>             Project: WildFly
>          Issue Type: Bug
>          Components: Security, Test Suite
>    Affects Versions: 10.0.0.CR4
>            Reporter: Ondrej Lukas
>            Assignee: Ondrej Lukas
>             Fix For: 11.0.0.Final
>
>
> Test coverage for {{@RunAs}} annotated servlets testing is not sufficient in the server.
> The {{WebSecurityRunAsTestCase}} in {{testsuite/integration/basic}} doesn't test the behavior correctly as mentioned in [this comment|https://issues.jboss.org/browse/WFLY-5015?focusedCommentId=13100897&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13100897] of WFLY-5015.
> I suggest to move the coverage to manualmode to be able to test also the behavior of {{@RunAs}} annotated {{HttpServlet.destroy()}} method during AS server shutdown.
> Possible "sun-shine" test scenario:
> * prepare deployment 
> ** use init parameter to configure path to a file which will serve as exceptions-counter for the application
> ** add EJB annotated with {{@RolesAllowed("Admin")}}
> ** add {{@RunAs("Admin")}} annotated servlet which calls the EJB in {{init()}}, {{doGet()}} and {{destroy()}} methods - if exception is thrown it increases the counter in the file (init param)
> * start server
> * deploy the test deployment
> * make call to the servlet
> * stop the server
> * start the server again
> * make call to the servlet
> * undeploy test deployment
> * check the counter (in file) if the exceptions count is 0
> Create "cloudy" scenarios based on modifications of the "sun-shine" one. (E.g. alter the run-as role name used in servlet and check the EJB call falls in all cases)



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list