@Test
void testLogin() throws ServletException {

    TestWebApplicationRequest request = new TestWebApplicationRequest();
    TestWebApplicationResponse response = new TestWebApplicationResponse();
    DefaultWebApplication webApp = new DefaultWebApplication();
    DefaultSecurityManager securityManager = new DefaultSecurityManager();
    webApp.linkRequestAndResponse(request, response);
    securityManager.setWebApplication(webApp);
    securityManager.addUser("username", "password", new String[]{"role1", "role2"});
    securityManager.login(request, "username", "password");
}