private void loadConsumers() { try { String oauthConfigString = ResourceLoader.getContent(OAUTH_CONFIG); store.initFromConfigString(oauthConfigString); } catch (Throwable t) { LOG.log(Level.WARNING, "Failed to initialize OAuth consumers from " + OAUTH_CONFIG, t); } }
private void loadConsumers() { try { String oauthConfigString = ResourceLoader.getContent(OAUTH_CONFIG); store.initFromConfigString(oauthConfigString); } catch (Throwable t) { if (LOG.isLoggable(Level.WARNING)) { LOG.logp(Level.WARNING, classname, "loadConsumers", MessageKeys.FAILED_TO_INIT, new Object[] {OAUTH_CONFIG}); LOG.log(Level.WARNING, "", t); } } }
private void loadConsumers() { try { String oauthConfigString = ResourceLoader.getContent(OAUTH_CONFIG); store.initFromConfigString(oauthConfigString); } catch (Throwable t) { LOG.log(Level.WARNING, "Failed to initialize OAuth consumers from " + OAUTH_CONFIG, t); } }
@Before public void setUp() throws Exception { store = new BasicOAuthStore(); store.initFromConfigString(SAMPLE_FILE); store.setDefaultCallbackUrl("default callback"); }
@Before public void setUp() throws Exception { store = new BasicOAuthStore(); store.initFromConfigString(SAMPLE_FILE); store.setDefaultCallbackUrl("default callback"); }
@Before public void setUp() throws Exception { store = new BasicOAuthStore(); store.initFromConfigString(SAMPLE_FILE); store.setDefaultCallbackUrl("default callback"); }
@Test public void testNullCallback() throws Exception { store = new BasicOAuthStore(); store.initFromConfigString(SAMPLE_FILE); FakeGadgetToken t = new FakeGadgetToken(); t.setAppUrl("http://localhost:8080/gadgets/oauth.xml"); OAuthServiceProvider provider = new OAuthServiceProvider("req", "authorize", "access"); ConsumerInfo consumerInfo = store.getConsumerKeyAndSecret(t, "", provider); OAuthConsumer consumer = consumerInfo.getConsumer(); assertEquals("gadgetConsumer", consumer.consumerKey); assertNull(consumerInfo.getKeyName()); assertNull(consumerInfo.getCallbackUrl()); } }
@Test public void testNullCallback() throws Exception { store = new BasicOAuthStore(); store.initFromConfigString(SAMPLE_FILE); FakeGadgetToken t = new FakeGadgetToken(); t.setAppUrl("http://localhost:8080/samplecontainer/examples/oauth.xml"); OAuthServiceProvider provider = new OAuthServiceProvider("req", "authorize", "access"); ConsumerInfo consumerInfo = store.getConsumerKeyAndSecret(t, "", provider); OAuthConsumer consumer = consumerInfo.getConsumer(); assertEquals("gadgetConsumer", consumer.consumerKey); assertNull(consumerInfo.getKeyName()); assertNull(consumerInfo.getCallbackUrl()); } }
@Test public void testNullCallback() throws Exception { store = new BasicOAuthStore(); store.initFromConfigString(SAMPLE_FILE); FakeGadgetToken t = new FakeGadgetToken(); t.setAppUrl("http://localhost:8080/gadgets/oauth.xml"); OAuthServiceProvider provider = new OAuthServiceProvider("req", "authorize", "access"); ConsumerInfo consumerInfo = store.getConsumerKeyAndSecret(t, "", provider); OAuthConsumer consumer = consumerInfo.getConsumer(); assertEquals("gadgetConsumer", consumer.consumerKey); assertNull(consumerInfo.getKeyName()); assertNull(consumerInfo.getCallbackUrl()); } }