PLCOAuthProvider implements OAuthProvider { @Override public OAuthToken getAccessToken(String token) { OAuthToken t = tokenDao.getByToken(token); return t.isAuthorized() ? t : null; } @Inject  PLCOAuthProvider(TokenDao tokenDao, ConsumerDao consumerDao); @Override OAuthConsumer getConsumer(String consumerKey); @Override OAuthToken newRequestToken(String consumerKey, String callbackUrl, Map<String, List<String>> attributes); @Override OAuthToken getRequestToken(String token); @Override OAuthToken newAccessToken(com.sun.jersey.oauth.server.spi.OAuthToken requestToken, String verifier); @Override OAuthToken getAccessToken(String token);  }
@Test public void getAccessToken() { com.fiveamsolutions.plc.data.oauth.OAuthToken t = provider.getAccessToken(token.getToken()); assertNull(t); token.setAuthorized(true); t = provider.getAccessToken(token.getToken()); assertNotNull(t); }