@Test public void testRegister() throws Exception { try { factory.register(null, null); fail("Expected Null Pointer Exception"); } catch (NullPointerException e) { } try { factory.register("Basic", null); fail("Expected Null Pointer Exception"); } catch (NullPointerException e) { } assertEquals(0, DispatchHttpChallengeFactory.challengeFactoriesByAuthScheme.size()); factory.register("Basic", new BasicHttpChallengeFactory()); assertEquals(1, DispatchHttpChallengeFactory.challengeFactoriesByAuthScheme.size()); }
public void register(String authScheme, HttpChallengeFactory factory) { if (authScheme == null) { throw new NullPointerException("authScheme"); } if (factory == null) { throw new NullPointerException("factory"); } challengeFactoriesByAuthScheme.put(authScheme, factory); }
DispatchHttpChallengeFactory implements HttpChallengeFactory { public void register(String authScheme, HttpChallengeFactory factory) { if (authScheme == null) { throw new NullPointerException("authScheme"); } if (factory == null) { throw new NullPointerException("factory"); } challengeFactoriesByAuthScheme.put(authScheme, factory); } }
DispatchHttpChallengeFactory implements HttpChallengeFactory { public void register(String authScheme, HttpChallengeFactory factory) { if (authScheme == null) { throw new NullPointerException("authScheme"); } if (factory == null) { throw new NullPointerException("factory"); } challengeFactoriesByAuthScheme.put(authScheme, factory); }  }
DispatchHttpChallengeFactory implements HttpChallengeFactory { public void register(String authScheme, HttpChallengeFactory factory) { if (authScheme == null) { throw new NullPointerException("authScheme"); } if (factory == null) { throw new NullPointerException("factory"); } challengeFactoriesByAuthScheme.put(authScheme, factory); }  static void clear(); void register(String authScheme, HttpChallengeFactory factory); @Override HttpResponseMessage createChallenge(HttpRequestMessage httpRequestMessage,
                                               HttpRealmInfo realm,
                                               Object... params); HttpChallengeFactory lookup(String authScheme); }
DispatchHttpChallengeFactory implements HttpChallengeFactory { public void register(String authScheme, HttpChallengeFactory factory) { if (authScheme == null) { throw new NullPointerException("authScheme"); } if (factory == null) { throw new NullPointerException("factory"); } challengeFactoriesByAuthScheme.put(authScheme, factory); }  static void clear(); void register(String authScheme, HttpChallengeFactory factory); @Override HttpResponseMessage createChallenge(HttpRequestMessage httpRequestMessage,
                                               HttpRealmInfo realm,
                                               Object... params); HttpChallengeFactory lookup(String authScheme); static Map<String, HttpChallengeFactory> challengeFactoriesByAuthScheme; }