Examples of OAuth2Profile


Examples of com.eviware.soapui.impl.rest.OAuth2Profile

    public void setUp() throws Exception {
        originalDialogs = UISupport.getDialogs();
        stubbedDialogs = new StubbedDialogs();
        UISupport.setDialogs(stubbedDialogs);
        OAuth2ProfileConfig configuration = OAuth2ProfileConfig.Factory.newInstance();
        profile = new OAuth2Profile(ModelItemFactory.makeOAuth2ProfileContainer(), configuration);

        clientFacade = mock(OAuth2ClientFacade.class);
        action = new RefreshOAuthAccessTokenAction(profile) {
            @Override
            protected OAuth2ClientFacade getOAuthClientFacade() {
View Full Code Here

Examples of com.eviware.soapui.impl.rest.OAuth2Profile

    public void setUp() throws Exception {
        originalDialogs = UISupport.getDialogs();
        stubbedDialogs = new StubbedDialogs();
        UISupport.setDialogs(stubbedDialogs);
        OAuth2ProfileConfig configuration = OAuth2ProfileConfig.Factory.newInstance();
        profile = new OAuth2Profile(ModelItemFactory.makeOAuth2ProfileContainer(), configuration);
    }
View Full Code Here

Examples of com.eviware.soapui.impl.rest.OAuth2Profile

        assertThat(httpRequest.getHeaders(OAuth.HeaderType.AUTHORIZATION), is(anEmptyArray()));
    }

    @Test
    public void automaticallyRefreshAccessTokenIfExpired() throws Exception {
        OAuth2Profile profileWithRefreshToken = setProfileWithRefreshTokenAndExpiredAccessToken();
        oAuth2FilterWithMockOAuth2ClientFacade(profileWithRefreshToken);
        oAuth2RequestFilter.filterRestRequest(mockContext, restRequest);

        String actualAccessTokenHeader = httpRequest.getHeaders((OAuth.HeaderType.AUTHORIZATION))[0].getValue();
        assertThat(actualAccessTokenHeader, is("Bearer " + OAuth2TestUtils.ACCESS_TOKEN));
View Full Code Here

Examples of com.eviware.soapui.impl.rest.OAuth2Profile

        assertThat(actualAccessTokenHeader, is("Bearer " + OAuth2TestUtils.ACCESS_TOKEN));
    }

    @Test
    public void doesNotRefreshAccessTokenWhenRefreshMethodIsManual() throws SoapUIException {
        OAuth2Profile profileWithRefreshToken = setProfileWithRefreshTokenAndExpiredAccessToken();
        profileWithRefreshToken.setRefreshAccessTokenMethod(OAuth2Profile.RefreshAccessTokenMethods.MANUAL);
        oAuth2FilterWithMockOAuth2ClientFacade(profileWithRefreshToken);
        oAuth2RequestFilter.filterRestRequest(mockContext, restRequest);

        assertThat(profileWithRefreshToken.getAccessToken(), is(EXPIRED_TOKEN));
    }
View Full Code Here

Examples of com.eviware.soapui.impl.rest.OAuth2Profile

        assertThat(profileWithRefreshToken.getAccessToken(), is(EXPIRED_TOKEN));
    }

    private OAuth2Profile setProfileWithRefreshTokenAndExpiredAccessToken() throws SoapUIException {
        final OAuth2Profile profileWithRefreshToken = OAuth2TestUtils.getOAuthProfileWithRefreshToken();
        setExpiredAccessToken(profileWithRefreshToken);

        oAuth2ProfileContainer.getOAuth2ProfileList().set(0, profileWithRefreshToken);
        restRequest.setSelectedAuthProfileAndAuthType(profileWithRefreshToken.getName(), O_AUTH_2_0);
        return profileWithRefreshToken;
    }
View Full Code Here

Examples of com.eviware.soapui.impl.rest.OAuth2Profile

        realLogger = OAuth2RequestFilter.getLog();
        OAuth2RequestFilter.setLog(mockLogger);
    }

    private void setupProfileWithRefreshToken() throws SoapUIException {
        final OAuth2Profile profileWithRefreshToken = OAuth2TestUtils.getOAuthProfileWithRefreshToken();
        setExpiredAccessToken(profileWithRefreshToken);
        injectProfile(profileWithRefreshToken);

        oAuth2ProfileContainer.getOAuth2ProfileList().set(0, profileWithRefreshToken);
        oAuth2Profile = profileWithRefreshToken;
View Full Code Here

Examples of com.eviware.soapui.impl.rest.OAuth2Profile

            }
        };
    }

    private void setupProfileWithAutomationScripts() throws SoapUIException {
        final OAuth2Profile profileWithAutomationScripts = makeProfileWithAutomationScripts();
        setExpiredAccessToken(profileWithAutomationScripts);
        injectProfile(profileWithAutomationScripts);
        oAuth2FilterWithMockOAuth2ClientFacade(profileWithAutomationScripts);
        Runnable browserCallbackSimulator = new Runnable() {
            public void run() {
                try {
                    Thread.sleep(50);
                } catch (InterruptedException ignore) {

                }
                profileWithAutomationScripts.applyRetrievedAccessToken(RETRIEVED_ACCESS_TOKEN);
            }
        };
        new Thread(browserCallbackSimulator).start();
    }
View Full Code Here

Examples of com.eviware.soapui.impl.rest.OAuth2Profile

                CredentialsConfig.AuthType.O_AUTH_2_0);
        oAuth2Profile = profileWithAutomationScripts;
    }

    private OAuth2Profile makeProfileWithAutomationScripts() throws SoapUIException {
        final OAuth2Profile profileWithAutomationScripts = OAuth2TestUtils.getOAuthProfileWithDefaultValues();
        profileWithAutomationScripts.setAutomationJavaScripts(Arrays.asList("doLoginAndConsent()"));
        return profileWithAutomationScripts;
    }
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.