Search in sources :

Example 1 with TestSession

use of com.developmentontheedge.be5.test.TestSession in project be5 by DevelopmentOnTheEdge.

the class UserHelper method initGuest.

public void initGuest(Request req) {
    Locale locale = Locale.US;
    String remoteAddr = "";
    Session session;
    if (req != null) {
        locale = req.getLocale();
        remoteAddr = req.getRemoteAddr();
        session = req.getSession();
    } else {
        session = new TestSession();
    }
    if (ModuleLoader2.getDevRoles().size() > 0) {
        saveUser("dev", ModuleLoader2.getDevRoles(), ModuleLoader2.getDevRoles(), locale, remoteAddr, session);
    } else {
        List<String> roles = Collections.singletonList(RoleType.ROLE_GUEST);
        saveUser(RoleType.ROLE_GUEST, roles, roles, locale, remoteAddr, session);
    }
}
Also used : Locale(java.util.Locale) TestSession(com.developmentontheedge.be5.test.TestSession) TestSession(com.developmentontheedge.be5.test.TestSession) Session(com.developmentontheedge.be5.api.Session)

Aggregations

Session (com.developmentontheedge.be5.api.Session)1 TestSession (com.developmentontheedge.be5.test.TestSession)1 Locale (java.util.Locale)1