AuthenticatedURL { protected Authenticator getAuthenticator() { return authenticator; } AuthenticatedURL();  AuthenticatedURL(Authenticator authenticator);  AuthenticatedURL(Authenticator authenticator,
                          ConnectionConfigurator connConfigurator); static void setDefaultAuthenticator(Class<? extends Authenticator> authenticator); static Class<? extends Authenticator> getDefaultAuthenticator(); HttpURLConnection openConnection(URL url, Token token); static void injectToken(HttpURLConnection conn, Token token); static void extractToken(HttpURLConnection conn, Token token); static final String AUTH_COOKIE; }
@Test public void testGetAuthenticator() throws Exception { Authenticator authenticator = Mockito.mock(Authenticator.class); AuthenticatedURL aURL = new AuthenticatedURL(authenticator); Assert.assertEquals(authenticator, aURL.getAuthenticator()); }