protected static OAuth2Store getDummyStore() throws Exception { if (MockUtils.dummyStore == null) { final OAuth2Cache cache = new InMemoryCache(); final OAuth2Persister persister = MockUtils.getDummyPersister(); final OAuth2Encrypter encrypter = MockUtils.getDummyEncrypter(); final BlobCrypter stateCrypter = MockUtils.getDummyStateCrypter(); MockUtils.dummyStore = MockUtils.getDummyStore(cache, persister, encrypter, MockUtils.REDIRECT_URI, null, null, stateCrypter); } MockUtils.dummyStore.clearCache(); MockUtils.dummyStore.init(); return MockUtils.dummyStore; }
protected static OAuth2Store getDummyStore() throws Exception { if (MockUtils.dummyStore == null) { final OAuth2Cache cache = new InMemoryCache(); final OAuth2Persister persister = MockUtils.getDummyPersister(); final OAuth2Encrypter encrypter = MockUtils.getDummyEncrypter(); final BlobCrypter stateCrypter = MockUtils.getDummyStateCrypter(); MockUtils.dummyStore = MockUtils.getDummyStore(cache, persister, encrypter, MockUtils.REDIRECT_URI, null, null, stateCrypter); } MockUtils.dummyStore.clearCache(); MockUtils.dummyStore.init(); return MockUtils.dummyStore; }
@Test public void testGetOAuth2Store_1() throws Exception { final OAuth2FetcherConfig fixture = new OAuth2FetcherConfig(new GadgetOAuth2TokenStore( EasyMock.createNiceMock(OAuth2Store.class), EasyMock.createNiceMock(GadgetSpecFactory.class)), true); final OAuth2Store result = fixture.getOAuth2Store(); Assert.assertNotNull(result); Assert.assertEquals(false, result.clearCache()); }
@Test public void testGetOAuth2Store_1() throws Exception { final OAuth2FetcherConfig fixture = new OAuth2FetcherConfig(new GadgetOAuth2TokenStore( EasyMock.createNiceMock(OAuth2Store.class), EasyMock.createNiceMock(GadgetSpecFactory.class)), true); final OAuth2Store result = fixture.getOAuth2Store(); Assert.assertNotNull(result); Assert.assertEquals(false, result.clearCache()); }