Application use container managed security provided by Tomcat. Authentication information stored in a HSQLDB database (app use JDBCRealm), with JDBC URL: jdbc:hsqldb:hsql://localhost:9001/authusers, in table "users", with fields "user_name", "user_pass", "role_name". Liquibase servlet listener create this table on deploy.
If user have role welcome-webapp-user, he can access /welcome page.
Builded web archive path: build/welcomeauthwebapp.war.
Integration test use embedded Tomcat v.8.0.38, in-memory HSQLDB v.2.3.4, and HTMLUnit v.2.18.
Before running integration test you must ensure, that:
- Working directory of embedded Tomcat (by default /var/tmp) can be created and deleted by user, that run this test.
- Embedded HSQLDB can listen port 9001.
- Go to /welcome page URL.
- Check redirect to /sign-in page.
- Fill /sign-in form, send that form.
- Check redirect to /sign-in page with label of wrong credentials.
- Click on the link and go to /sign-up page.
- Fill /sign-up form, send that form.
- Check redirect to /welcome page with sended username.
- Click to the button and go to /sign-out page.
- Check redirect to /sign-in page with sign-out label.
To run integration test:
$ mvn verify