equal
deleted
inserted
replaced
71 System.out.println("Caught a LoginException, as expected"); |
71 System.out.println("Caught a LoginException, as expected"); |
72 } |
72 } |
73 |
73 |
74 // bad value for userProvider option |
74 // bad value for userProvider option |
75 |
75 |
76 Map<String, String> options = new HashMap<String, String>(); |
76 Map<String, String> options = new HashMap<>(); |
77 options.put(USER_PROVIDER_OPTION, "ldap://localhost:23456"); |
77 options.put(USER_PROVIDER_OPTION, "ldap://localhost:23456"); |
78 ldap.initialize(subject, null, null, options); |
78 ldap.initialize(subject, null, null, options); |
79 |
79 |
80 try { |
80 try { |
81 ldap.login(); |
81 ldap.login(); |
91 |
91 |
92 // empty set of options |
92 // empty set of options |
93 |
93 |
94 LdapLoginModule ldap = new LdapLoginModule(); |
94 LdapLoginModule ldap = new LdapLoginModule(); |
95 Subject subject = new Subject(); |
95 Subject subject = new Subject(); |
96 Map<String, String> options = new HashMap<String, String>(); |
96 Map<String, String> options = new HashMap<>(); |
97 ldap.initialize(subject, null, null, options); |
97 ldap.initialize(subject, null, null, options); |
98 |
98 |
99 try { |
99 try { |
100 ldap.login(); |
100 ldap.login(); |
101 throw new SecurityException("expected LoginException"); |
101 throw new SecurityException("expected LoginException"); |
108 |
108 |
109 private static void testWithCallbackHandler() throws Exception { |
109 private static void testWithCallbackHandler() throws Exception { |
110 |
110 |
111 LdapLoginModule ldap = new LdapLoginModule(); |
111 LdapLoginModule ldap = new LdapLoginModule(); |
112 Subject subject = new Subject(); |
112 Subject subject = new Subject(); |
113 Map<String, String> options = new HashMap<String, String>(); |
113 Map<String, String> options = new HashMap<>(); |
114 |
114 |
115 CallbackHandler goodHandler = new MyCallbackHandler(true); |
115 CallbackHandler goodHandler = new MyCallbackHandler(true); |
116 ldap.initialize(subject, goodHandler, null, options); |
116 ldap.initialize(subject, goodHandler, null, options); |
117 |
117 |
118 try { |
118 try { |