Examples of OAuthConsumerStore


Examples of org.apache.rave.portal.model.OAuthConsumerStore

        assertThat(oAuthConsumerStoreConverter.convert(oAuthConsumerStore), is(sameInstance(oAuthConsumerStore)));
    }

    @Test
    public void nullConversion() {
        OAuthConsumerStore oAuthConsumerStore = null;
        assertThat(oAuthConsumerStoreConverter.convert(oAuthConsumerStore), is(nullValue()));
    }
View Full Code Here

Examples of org.apache.rave.portal.model.OAuthConsumerStore

        assertThat(oAuthConsumerStoreConverter.convert(oAuthConsumerStore), is(nullValue()));
    }

    @Test
    public void newOAuthConsumerStore() {
        OAuthConsumerStore oAuthConsumerStore = new OAuthConsumerStoreImpl();
        oAuthConsumerStore.setId(1L);
        oAuthConsumerStore.setServiceName("servicename");
        oAuthConsumerStore.setCallbackUrl("callbackurl");
        oAuthConsumerStore.setConsumerKey("key");
        oAuthConsumerStore.setConsumerSecret("secret");
        oAuthConsumerStore.setGadgetUri("gadgeturi");
        oAuthConsumerStore.setKeyName("key");
        oAuthConsumerStore.setKeyType(OAuthConsumerStore.KeyType.HMAC_SYMMETRIC);

        JpaOAuthConsumerStore converted = oAuthConsumerStoreConverter.convert(oAuthConsumerStore);
        assertThat(converted, is(not(sameInstance(oAuthConsumerStore))));
        assertThat(converted, is(instanceOf(JpaOAuthConsumerStore.class)));
        assertThat(converted.getId(), is(equalTo(oAuthConsumerStore.getId())));
        assertThat(converted.getServiceName(), is(equalTo(oAuthConsumerStore.getServiceName())));
        assertThat(converted.getCallbackUrl(), is(equalTo(oAuthConsumerStore.getCallbackUrl())));
        assertThat(converted.getConsumerKey(), is(equalTo(oAuthConsumerStore.getConsumerKey())));
        assertThat(converted.getConsumerSecret(), is(equalTo(oAuthConsumerStore.getConsumerSecret())));
        assertThat(converted.getEntityId(), is(equalTo(oAuthConsumerStore.getId())));
        assertThat(converted.getGadgetUri(), is(equalTo(oAuthConsumerStore.getGadgetUri())));
        assertThat(converted.getKeyName(), is(equalTo(oAuthConsumerStore.getKeyName())));
        assertThat(converted.getKeyType(), is(equalTo(oAuthConsumerStore.getKeyType())));
    }
View Full Code Here

Examples of org.apache.rave.portal.model.OAuthConsumerStore

        assertThat(oAuthConsumerStore.getServiceName(), is(SERVICE_NAME_GOOGLE));
    }

    @Test
    public void testFindByUriAndServiceName() throws Exception {
        final OAuthConsumerStore store = repository.findByUriAndServiceName(GADGET_URI, SERVICE_NAME_GOOGLE);
        assertNotNull("OAuthConsumerStore In test db", store);
        assertEquals("gadgetSecret", store.getConsumerSecret());
        assertEquals(JpaOAuthConsumerStore.KeyType.HMAC_SYMMETRIC, store.getKeyType());
    }
View Full Code Here

Examples of org.apache.rave.portal.model.OAuthConsumerStore

        assertEquals(JpaOAuthConsumerStore.KeyType.HMAC_SYMMETRIC, store.getKeyType());
    }

    @Test
    public void testFindByUriAndServiceName_nullValue() throws Exception {
        final OAuthConsumerStore store = repository.findByUriAndServiceName(GADGET_URI, SERVICE_NAME_FOO);
        assertNull(store);
    }
View Full Code Here

Examples of org.apache.rave.portal.model.OAuthConsumerStore

    @Test
    @Transactional(readOnly=false)
    @Rollback(true)
    public void delete() {
        OAuthConsumerStore oAuthConsumerStore = repository.get(VALID_ID);
        assertThat(oAuthConsumerStore, is(notNullValue()));
        repository.delete(oAuthConsumerStore);
        oAuthConsumerStore = repository.get(VALID_ID);
        assertThat(oAuthConsumerStore, is(nullValue()));
    }
View Full Code Here

Examples of org.apache.rave.portal.model.OAuthConsumerStore

        service = new DefaultOAuthConsumerStoreService(repository);
    }

    @Test
    public void testFindByUriAndServiceName() throws Exception {
        OAuthConsumerStore dbConsumerStore = getOAuthConsumerStore();
        expect(repository.findByUriAndServiceName(GADGET_URI, SERVICE_NAME_GOOGLE)).andReturn(dbConsumerStore);
        replay(repository);

        OAuthConsumerStore consumerStore = service.findByUriAndServiceName(GADGET_URI, SERVICE_NAME_GOOGLE);
        assertNotNull("Found consumerStore in repo", consumerStore);
        assertEquals("gadgetConsumer", consumerStore.getConsumerKey());
        assertEquals(OAuthConsumerStore.KeyType.HMAC_SYMMETRIC, consumerStore.getKeyType());
    }
View Full Code Here

Examples of org.apache.rave.portal.model.OAuthConsumerStore

    }

    @Test
    public void testFindByUriAndServiceName_nullValue() throws Exception {
        expect(repository.findByUriAndServiceName(GADGET_URI, SERVICE_NAME_FOO)).andReturn(null);
        OAuthConsumerStore consumerStore = service.findByUriAndServiceName(GADGET_URI, SERVICE_NAME_FOO);
        assertNull(consumerStore);
    }
View Full Code Here

Examples of org.apache.rave.portal.model.OAuthConsumerStore

        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.OAuthConsumerStore

        assertThat(oAuthConsumerStoreConverter.convert(oAuthConsumerStore), is(nullValue()));
    }

    @Test
    public void newOAuthConsumerStore() {
        OAuthConsumerStore oAuthConsumerStore = new OAuthConsumerStoreImpl();
        oAuthConsumerStore.setId("1");
        oAuthConsumerStore.setServiceName("servicename");
        oAuthConsumerStore.setCallbackUrl("callbackurl");
        oAuthConsumerStore.setConsumerKey("key");
        oAuthConsumerStore.setConsumerSecret("secret");
        oAuthConsumerStore.setGadgetUri("gadgeturi");
        oAuthConsumerStore.setKeyName("key");
        oAuthConsumerStore.setKeyType(OAuthConsumerStore.KeyType.HMAC_SYMMETRIC);

        JpaOAuthConsumerStore converted = oAuthConsumerStoreConverter.convert(oAuthConsumerStore);
        assertThat(converted, is(not(sameInstance(oAuthConsumerStore))));
        assertThat(converted, is(instanceOf(JpaOAuthConsumerStore.class)));
        assertThat(converted.getId(), is(equalTo(oAuthConsumerStore.getId())));
        assertThat(converted.getServiceName(), is(equalTo(oAuthConsumerStore.getServiceName())));
        assertThat(converted.getCallbackUrl(), is(equalTo(oAuthConsumerStore.getCallbackUrl())));
        assertThat(converted.getConsumerKey(), is(equalTo(oAuthConsumerStore.getConsumerKey())));
        assertThat(converted.getConsumerSecret(), is(equalTo(oAuthConsumerStore.getConsumerSecret())));
        assertThat(converted.getEntityId().toString(), is(equalTo(oAuthConsumerStore.getId())));
        assertThat(converted.getGadgetUri(), is(equalTo(oAuthConsumerStore.getGadgetUri())));
        assertThat(converted.getKeyName(), is(equalTo(oAuthConsumerStore.getKeyName())));
        assertThat(converted.getKeyType(), is(equalTo(oAuthConsumerStore.getKeyType())));
    }
View Full Code Here

Examples of org.apache.rave.portal.model.OAuthConsumerStore

    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
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.