Examples of OAuthTokenInfo


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

     */
    @Override
    @Transactional
    public void deleteOAuthTokenInfo(String userId, String appUrl, String moduleId, String tokenName,
                                     String serviceName) {
        final OAuthTokenInfo oAuthTokenInfo =
                findOAuthTokenInfo(userId, appUrl, moduleId, tokenName, serviceName);
        if (oAuthTokenInfo != null) {
            repository.delete(oAuthTokenInfo);
        }
    }
View Full Code Here

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

        repo.setTemplate(template);
    }

    @Test
    public void findOAuthTokenInfo(){
        OAuthTokenInfo info = new OAuthTokenInfoImpl();
        String userId = "1234";
        String appUrl = "www.test.com";
        String moduleId = "2222";
        String tokenName = "token";
        String serviceName = "service";
        info.setUserId(userId);
        info.setAppUrl(appUrl);
        info.setModuleId(moduleId);
        info.setTokenName(tokenName);
        info.setServiceName(serviceName);
        expect(template.findOne(query(where("userId").is(userId)
                .andOperator(where("appUrl").is(appUrl))
                .andOperator(where("moduleId").is(moduleId))
                .andOperator(where("tokenName").is(tokenName))
                .andOperator(where("serviceName").is(serviceName))
View Full Code Here

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

    }

    @Test
    public void save_null(){
        OAuthTokenInfo info = new OAuthTokenInfoImpl();
        OAuthTokenInfo result;

        template.save(isA(OAuthTokenInfo.class), eq(OAUTH_TOKEN_COLLECTION));
        expectLastCall();
        replay(template);
View Full Code Here

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

    }

    @Test
    public void save(){
        OAuthTokenInfo item = new OAuthTokenInfoImpl("appUrl", "serviceName",
                "tokenName", "accessToken", "sessionHandle",
                "tokenSecret", "userId", 1111L);
        OAuthTokenInfo result;
        item.setId("1234L");

        template.save(isA(OAuthTokenInfo.class), eq(OAUTH_TOKEN_COLLECTION));
        expectLastCall();

        result = repo.save(item);
        assertNotNull(result.getId());
        assertThat(result.getId(), is(equalTo("1234L")));

    }
View Full Code Here

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

    }

    @Test
    public void get(){
        OAuthTokenInfo result;
        OAuthTokenInfo item = new OAuthTokenInfoImpl("appUrl", "serviceName",
                "tokenName", "accessToken", "sessionHandle",
                "tokenSecret", "userId", 1111L);
        item.setId("1234L");

        expect(template.findById("1234L", CLASS2, OAUTH_TOKEN_COLLECTION)).andReturn((OAuthTokenInfoImpl)item);
        replay(template);

        result = repo.get("1234L");
View Full Code Here

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

    }

    @Test
    public void delete(){
        OAuthTokenInfo item = new OAuthTokenInfoImpl("appUrl", "serviceName",
                "tokenName", "accessToken", "sessionHandle",
                "tokenSecret", "userId", 1111L);
        item.setId("1234L");

        template.remove(item);
        expectLastCall();
        expect(template.findById("1234L", CLASS2, OAUTH_TOKEN_COLLECTION)).andReturn((OAuthTokenInfoImpl)item);
        replay(template);
View Full Code Here

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

     * {@inheritDoc}
     */
    @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());
    }
View Full Code Here

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

     * {@inheritDoc}
     */
    @Override
    public void setTokenInfo(SecurityToken securityToken, ConsumerInfo consumerInfo, String serviceName,
                             String tokenName, TokenInfo tokenInfo) throws GadgetException {
        OAuthTokenInfo oAuthTokenInfo = new OAuthTokenInfoImpl(securityToken.getAppUrl(),
                serviceName, tokenName, tokenInfo.getAccessToken(), tokenInfo.getSessionHandle(),
                tokenInfo.getTokenSecret(), securityToken.getViewerId(), tokenInfo.getTokenExpireMillis());
        tokenInfoService.saveOAuthTokenInfo(oAuthTokenInfo);
    }
View Full Code Here

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

    @Autowired
    private JpaOAuthTokenInfoConverter oAuthTokenInfoConverter;

    @Test
    public void noConversion() {
        OAuthTokenInfo oAuthTokenInfo = new JpaOAuthTokenInfo();
        assertThat(oAuthTokenInfoConverter.convert(oAuthTokenInfo), is(sameInstance(oAuthTokenInfo)));
    }
View Full Code Here

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

        assertThat(oAuthTokenInfoConverter.convert(oAuthTokenInfo), is(sameInstance(oAuthTokenInfo)));
    }

    @Test
    public void nullConversion() {
        OAuthTokenInfo oAuthTokenInfo = null;
        assertThat(oAuthTokenInfoConverter.convert(oAuthTokenInfo), is(nullValue()));
    }
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.