@Test public void oAuthAuthorizerWithAccessTokenSecret() { String accessToken = "TestAccessToken"; Header[] header = null; HttpRequestBase requestBase = new HttpGet(); try { requestBase.setURI(new URI(URL_STRING)); OAuth2Authorizer oauthAuthorizer = new OAuth2Authorizer(accessToken); oauthAuthorizer.authorize(requestBase); header = requestBase.getAllHeaders(); Assert.assertEquals("Bearer "+accessToken,extractHeaderParams(header, requestBase)); } catch (Exception e) { log.debug(e.getMessage()); } }
@Override public void authorize(HttpRequestBase httpRequest) throws FMSException { httpRequest.setHeader("Authorization", "Bearer " + accessToken); }
OAuth2Authorizer implements IAuthorizer { @Override public void authorize(HttpRequestBase httpRequest) throws FMSException { httpRequest.setHeader("Authorization", "Bearer " + accessToken); } }
OAuth2Authorizer implements IAuthorizer { @Override public void authorize(HttpRequestBase httpRequest) throws FMSException { httpRequest.setHeader("Authorization", "Bearer " + accessToken); } OAuth2Authorizer(String accessToken); }
OAuth2Authorizer implements IAuthorizer { @Override public void authorize(HttpRequestBase httpRequest) throws FMSException { httpRequest.setHeader("Authorization", "Bearer " + accessToken); } OAuth2Authorizer(String accessToken); @Override void authorize(HttpRequestBase httpRequest); @Override void authorize(HttpURLConnection httpUrlConnection); String getAccessToken(); void setAccessToken(String accessToken); }
OAuth2Authorizer implements IAuthorizer { @Override public void authorize(HttpRequestBase httpRequest) throws FMSException { httpRequest.setHeader("Authorization", "Bearer " + accessToken); } OAuth2Authorizer(String accessToken); @Override void authorize(HttpRequestBase httpRequest); @Override void authorize(HttpURLConnection httpUrlConnection); String getAccessToken(); void setAccessToken(String accessToken);  }