Examples of OAuthConsumerStoreImpl


Examples of org.apache.rave.portal.model.impl.OAuthConsumerStoreImpl

    private OAuthConsumerStoreService consumerStoreService;
    private OAuthTokenInfoService tokenInfoService;

    @Test
    public void testGetConsumerKeyAndSecret() throws Exception {
        OAuthConsumerStore consumerStore = new OAuthConsumerStoreImpl();
        consumerStore.setGadgetUri(GADGET_URI);
        consumerStore.setConsumerKey("gadgetConsumer");
        consumerStore.setConsumerSecret(CONSUMER_SECRET);
        consumerStore.setKeyType(OAuthConsumerStore.KeyType.HMAC_SYMMETRIC);
        OAuthServiceProvider provider = new OAuthServiceProvider(null, null, null);

        expect(consumerStoreService.findByUriAndServiceName(GADGET_URI, SERVICE_NAME))
                .andReturn(consumerStore);
        replay(consumerStoreService);
View Full Code Here

Examples of org.apache.rave.portal.model.impl.OAuthConsumerStoreImpl

        OAuthConsumerStore consumerStore = service.findByUriAndServiceName(GADGET_URI, SERVICE_NAME_FOO);
        assertNull(consumerStore);
    }

    OAuthConsumerStore getOAuthConsumerStore() {
        OAuthConsumerStore consumerStore = new OAuthConsumerStoreImpl();
        consumerStore.setCallbackUrl("http://oauth.gmodules.com/gadgets/oauthcallback");
        consumerStore.setConsumerKey("gadgetConsumer");
        consumerStore.setConsumerSecret("gadgetSecret");
        consumerStore.setGadgetUri(GADGET_URI);
        consumerStore.setServiceName(SERVICE_NAME_GOOGLE);
        consumerStore.setKeyName("keyName");
        consumerStore.setKeyType(OAuthConsumerStore.KeyType.HMAC_SYMMETRIC);
        return consumerStore;
    }
View Full Code Here

Examples of org.apache.rave.portal.model.impl.OAuthConsumerStoreImpl

    @Test
    public void findUriAndServiceNameValid() {
        String gadgetUri = "gadgetUri";
        String serviceName = "serviceName";
        OAuthConsumerStoreImpl found = new OAuthConsumerStoreImpl();
        expect(template.findOne(query(where("gadgetUri").is(gadgetUri).andOperator(where("serviceName").is(serviceName))), MongoDbOauthConsumerStoreRepository.CLASS, CollectionNames.OAUTH_CONSUMER_COLLECTION)).andReturn(found);
        replay(template);

        OAuthConsumerStore returned = oauthConsumerStoreRepository.findByUriAndServiceName(gadgetUri, serviceName);
View Full Code Here

Examples of org.apache.rave.portal.model.impl.OAuthConsumerStoreImpl

    }

    @Test
    public void get_Valid() {
        String id = "123";
        OAuthConsumerStoreImpl found = new OAuthConsumerStoreImpl();
        expect(template.findById(id, oauthConsumerStoreRepository.CLASS, CollectionNames.OAUTH_CONSUMER_COLLECTION)).andReturn(found);
        replay(template);

        assertThat(found, is(sameInstance(oauthConsumerStoreRepository.get(id))));
    }
View Full Code Here

Examples of org.apache.rave.portal.model.impl.OAuthConsumerStoreImpl

        assertThat(found, is(sameInstance(oauthConsumerStoreRepository.get(id))));
    }

    @Test
    public void save_Valid(){
        OAuthConsumerStore item = new OAuthConsumerStoreImpl();
        template.save(item, CollectionNames.OAUTH_CONSUMER_COLLECTION);
        expectLastCall();
        replay(template);

        OAuthConsumerStore returned = oauthConsumerStoreRepository.save(item);
View Full Code Here

Examples of org.apache.rave.portal.model.impl.OAuthConsumerStoreImpl

        verify(template);
    }

    @Test
    public void save_Null_Id(){
        OAuthConsumerStore item = new OAuthConsumerStoreImpl();
        item.setId("1232");
        template.save(item, CollectionNames.OAUTH_CONSUMER_COLLECTION);
        expectLastCall();
        replay(template);

        OAuthConsumerStore returned = oauthConsumerStoreRepository.save(item);
View Full Code Here

Examples of org.apache.rave.portal.model.impl.OAuthConsumerStoreImpl

        assertThat(item, is(sameInstance(returned)));
    }

    @Test
    public void delete_Valid() {
        OAuthConsumerStore item = new OAuthConsumerStoreImpl();
        item.setId("123");

        expect(template.findById(item.getId(), oauthConsumerStoreRepository.CLASS, CollectionNames.OAUTH_CONSUMER_COLLECTION)).andReturn((OAuthConsumerStoreImpl)item);
        template.remove(item);
        expectLastCall();
        replay(template);

        oauthConsumerStoreRepository.delete(item);
View Full Code Here

Examples of org.apache.rave.portal.model.impl.OAuthConsumerStoreImpl

        OAuthConsumerStore consumerStore = service.findByUriAndServiceName(GADGET_URI, SERVICE_NAME_FOO);
        assertNull(consumerStore);
    }

    OAuthConsumerStore getOAuthConsumerStore() {
        OAuthConsumerStore consumerStore = new OAuthConsumerStoreImpl();
        consumerStore.setCallbackUrl("http://oauth.gmodules.com/gadgets/oauthcallback");
        consumerStore.setConsumerKey("gadgetConsumer");
        consumerStore.setConsumerSecret("gadgetSecret");
        consumerStore.setGadgetUri(GADGET_URI);
        consumerStore.setServiceName(SERVICE_NAME_GOOGLE);
        consumerStore.setKeyName("keyName");
        consumerStore.setKeyType(OAuthConsumerStore.KeyType.HMAC_SYMMETRIC);
        return consumerStore;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.