### Question:
DefaultOAuthStore implements OAuthStore { @Override public TokenInfo getTokenInfo(SecurityToken securityToken, ConsumerInfo consumerInfo, String serviceName, String tokenName) throws GadgetException { OAuthTokenInfo oAuthTokenInfo = tokenInfoService.findOAuthTokenInfo( securityToken.getViewerId(), securityToken.getAppUrl(), OAuthTokenInfo.MODULE_ID, tokenName, serviceName); if (oAuthTokenInfo == null) { return null; } return new TokenInfo(oAuthTokenInfo.getAccessToken(), oAuthTokenInfo.getTokenSecret(), oAuthTokenInfo.getSessionHandle(), oAuthTokenInfo.getTokenExpireMillis()); } DefaultOAuthStore(String defaultCallbackUrl,
                             String pathToPrivateKey,
                             String privateKeyName); @Override ConsumerInfo getConsumerKeyAndSecret(SecurityToken securityToken, String serviceName,
                                                OAuthServiceProvider provider); @Override TokenInfo getTokenInfo(SecurityToken securityToken, ConsumerInfo consumerInfo, String serviceName,
                                  String tokenName); @Override void setTokenInfo(SecurityToken securityToken, ConsumerInfo consumerInfo, String serviceName,
                             String tokenName, TokenInfo tokenInfo); @Override void removeToken(SecurityToken securityToken, ConsumerInfo consumerInfo, String serviceName,
                            String tokenName);  }### Answer:
@Test public void testGetTokenInfo() throws Exception { final String testTokenName = "testTokenName"; OAuthTokenInfo oAuthTokenInfo = new OAuthTokenInfoImpl(); oAuthTokenInfo.setTokenName(testTokenName); oAuthTokenInfo.setTokenSecret(CONSUMER_SECRET); OAuthStore.ConsumerInfo consumerInfo = createMock(OAuthStore.ConsumerInfo.class); expect(tokenInfoService.findOAuthTokenInfo(token.getViewerId(), token.getAppUrl(), OAuthTokenInfoImpl.MODULE_ID, testTokenName, SERVICE_NAME)).andReturn(oAuthTokenInfo); replay(tokenInfoService); final OAuthStore.TokenInfo tokenInfo = oAuthStore.getTokenInfo(token, consumerInfo, SERVICE_NAME, testTokenName); assertNotNull("Got TokenInfo", tokenInfo); assertEquals(CONSUMER_SECRET, tokenInfo.getTokenSecret()); verify(tokenInfoService); }