JahiaLoginModule implements LoginModule { public static Credentials getSystemCredentials() { return getSystemCredentials(null,null,null); }  @Override void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options); @Override boolean login(); static Token removeToken(String name, String key); static Token getToken(String name, String key); @Override boolean commit(); @Override boolean abort(); boolean logout(); static Credentials getSystemCredentials(); @Deprecated static Credentials getSystemCredentials(String username); static Credentials getSystemCredentials(String username, String realm); @Deprecated static Credentials getSystemCredentials(String username, List<String> deniedPathes); static Credentials getSystemCredentials(String username, String realm, List<String> deniedPathes); static Credentials getGuestCredentials(); @Deprecated static Credentials getCredentials(String username); static Credentials getCredentials(String username, String realm); @Deprecated static Credentials getCredentials(String username, List<String> deniedPathes); static Credentials getCredentials(String username, String realm, List<String> deniedPathes); static final String SYSTEM; static final String GUEST; static final String REALM_ATTRIBUTE; }
@Test public void testSystemCredentials() throws HttpException { assertEquals(JahiaLoginModule.SYSTEM, ((SimpleCredentials) JahiaLoginModule.getSystemCredentials()).getUserID()); assertEquals(JahiaLoginModule.SYSTEM, ((SimpleCredentials) JahiaLoginModule.getSystemCredentials(null, (String) null)).getUserID()); assertEquals(JahiaLoginModule.SYSTEM, ((SimpleCredentials) JahiaLoginModule.getSystemCredentials(null, null, null)).getUserID()); }