RefreshAuthenticator implements okhttp3.Authenticator { @Override public Request authenticate(Route route, Response response) throws IOException { return authenticator.refresh(response); } RefreshAuthenticator(Authenticator authenticator); @Override Request authenticate(Route route, Response response); final Authenticator authenticator; }
@Test public void testAuthenticate_callsAuthenticatorRefresh() throws Exception { refreshAuthenticator.authenticate(null, response); verify(authenticator).refresh(eq(response)); }