@Test(expected = RemoteApiException.class) public void testReAuthThrowRemoteApiException() throws RemoteApiException { proxy.reAuthOrThrow(JIRAWEBHOOK, new RemoteApiException(HttpStatus.SC_INTERNAL_SERVER_ERROR, "message")); }
@Override public synchronized void reAuthOrThrow(String userId, RemoteApiException remoteApiException) throws RemoteApiException { if (validateResponseCode(Status.UNAUTHORIZED, remoteApiException.getCode())) { if (shouldInvalidateSession(userId)) { invalidate(userId); authenticate(userId); } } else { throw remoteApiException; } }
AuthenticationProxyImpl implements AuthenticationProxy { @Override public synchronized void reAuthOrThrow(String userId, RemoteApiException remoteApiException) throws RemoteApiException { if (validateResponseCode(Status.UNAUTHORIZED, remoteApiException.getCode())) { if (shouldInvalidateSession(userId)) { invalidate(userId); authenticate(userId); } } else { throw remoteApiException; } } }
AuthenticationProxyImpl implements AuthenticationProxy { @Override public synchronized void reAuthOrThrow(String userId, RemoteApiException remoteApiException) throws RemoteApiException { if (validateResponseCode(Status.UNAUTHORIZED, remoteApiException.getCode())) { if (shouldInvalidateSession(userId)) { invalidate(userId); authenticate(userId); } } else { throw remoteApiException; } }  }
AuthenticationProxyImpl implements AuthenticationProxy { @Override public synchronized void reAuthOrThrow(String userId, RemoteApiException remoteApiException) throws RemoteApiException { if (validateResponseCode(Status.UNAUTHORIZED, remoteApiException.getCode())) { if (shouldInvalidateSession(userId)) { invalidate(userId); authenticate(userId); } } else { throw remoteApiException; } }  @PostConstruct void init(); @Override void authenticate(String userId); @Override boolean isAuthenticated(String user); @Override void invalidate(String userId); @Override AuthenticationToken getToken(String configurationId); @Override String getSessionToken(String configurationId); @Override synchronized void reAuthOrThrow(String userId, RemoteApiException remoteApiException); @Override synchronized AuthenticationToken reAuthSessionOrThrow(String sessionToken, RemoteApiException remoteApiException); @Override boolean sessionNoLongerEntitled(int code); @Override boolean sessionUnauthorized(int code); @Override void registerUser(String userId, KeyStore keyStore, String keyStorePass); @Override Client httpClientForUser(String userId, ServiceName serviceName); @Override Client httpClientForSessionToken(String sessionToken, ServiceName serviceName); }
AuthenticationProxyImpl implements AuthenticationProxy { @Override public synchronized void reAuthOrThrow(String userId, RemoteApiException remoteApiException) throws RemoteApiException { if (validateResponseCode(Status.UNAUTHORIZED, remoteApiException.getCode())) { if (shouldInvalidateSession(userId)) { invalidate(userId); authenticate(userId); } } else { throw remoteApiException; } }  @PostConstruct void init(); @Override void authenticate(String userId); @Override boolean isAuthenticated(String user); @Override void invalidate(String userId); @Override AuthenticationToken getToken(String configurationId); @Override String getSessionToken(String configurationId); @Override synchronized void reAuthOrThrow(String userId, RemoteApiException remoteApiException); @Override synchronized AuthenticationToken reAuthSessionOrThrow(String sessionToken, RemoteApiException remoteApiException); @Override boolean sessionNoLongerEntitled(int code); @Override boolean sessionUnauthorized(int code); @Override void registerUser(String userId, KeyStore keyStore, String keyStorePass); @Override Client httpClientForUser(String userId, ServiceName serviceName); @Override Client httpClientForSessionToken(String sessionToken, ServiceName serviceName);  }