AbstractLoginModule implements LoginModule { @Override public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) { this.subject = subject; this.callbackHandler = callbackHandler; this.sharedState = sharedState; this.options = (options == null) ? ConfigurationParameters.EMPTY : ConfigurationParameters.of(options); }  @Override void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options); @Override boolean logout(); @Override boolean abort(); static final String SHARED_KEY_CREDENTIALS; static final String SHARED_KEY_LOGIN_NAME; static final String SHARED_KEY_ATTRIBUTES; static final String SHARED_KEY_PRE_AUTH_LOGIN; }
@Test public void testInitializeWithOptions() { AbstractLoginModule lm = new TestLoginModule(TestCredentials.class); Map options = ImmutableMap.of("key", "value"); lm.initialize(new Subject(), null, Collections.emptyMap(), options); assertNotSame(options, lm.options); assertEquals(options, lm.options); ConfigurationParameters options2 = ConfigurationParameters.of(options); lm.initialize(new Subject(), null, Collections.emptyMap(), options2); assertSame(options2, lm.options); }