Package org.agorava.oauth.settings

Examples of org.agorava.oauth.settings.PropertyOAuthAppSettingsBuilder


    @ApplicationScoped
    @Produces
    @FakeService
    public OAuthAppSettings produceFirstSetting() {
        PropertyOAuthAppSettingsBuilder builder = new PropertyOAuthAppSettingsBuilder();
        return builder.build();
    }
View Full Code Here


    @ApplicationScoped
    @Produces
    @FakeService2
    public OAuthAppSettings produceSecondSetting() {
        PropertyOAuthAppSettingsBuilder builder = new PropertyOAuthAppSettingsBuilder();
        return builder.prefix("test").build();
    }
View Full Code Here

*/
public class PropertySettingsBuilderTest {
    @Test
    public void testDefaultBuild() {

        OAuthAppSettingsBuilder builderOAuthApp = new PropertyOAuthAppSettingsBuilder();
        OAuthAppSettings settings = builderOAuthApp.build();
        Assert.assertEquals(settings.getCallback(), "/dummyCallback");

    }
View Full Code Here

    }

    @Test
    public void testAbsoluteUrlBuild() {

        PropertyOAuthAppSettingsBuilder builderOAuthApp = new PropertyOAuthAppSettingsBuilder();
        builderOAuthApp.bundleName("agoravahttp");
        OAuthAppSettings settings = builderOAuthApp.build();
        Assert.assertEquals(settings.getCallback(), "http://dummyCallback");

    }
View Full Code Here


    @Test
    public void testSSLBuild() {

        PropertyOAuthAppSettingsBuilder builderOAuthApp = new PropertyOAuthAppSettingsBuilder();
        builderOAuthApp.bundleName("agoravassl");
        OAuthAppSettings settings = builderOAuthApp.build();
        Assert.assertEquals(settings.getApiKey(), "dummy");
        Assert.assertEquals(settings.getApiSecret(), "dummySecret");
        Assert.assertEquals(settings.getScope(), "dummyScope");
        Assert.assertEquals(settings.getCallback(), "https://dummyCallback");
View Full Code Here

    }

    @Test
    public void testDefaultBuildWithPrefix() {

        PropertyOAuthAppSettingsBuilder builder = new PropertyOAuthAppSettingsBuilder();
        builder.prefix("test");
        OAuthAppSettings settings = builder.build();
        Assert.assertEquals(settings.getApiKey(), "dummy2");
        Assert.assertEquals(settings.getApiSecret(), "dummySecret2");
    }
View Full Code Here

    }

    @Test(expected = AgoravaException.class)
    public void testDefaultBuildWithIncompletePrefix() {

        PropertyOAuthAppSettingsBuilder builder = new PropertyOAuthAppSettingsBuilder();
        builder.prefix("test2");
        builder.build();
    }
View Full Code Here


    @Test(expected = AgoravaException.class)
    public void testDefaultBuildWithBadPrefix() {

        PropertyOAuthAppSettingsBuilder builder = new PropertyOAuthAppSettingsBuilder();
        builder.prefix("test3");
        builder.build();
    }
View Full Code Here

    }

    @Test
    public void testOtherBundleBuild() {

        PropertyOAuthAppSettingsBuilder builder = new PropertyOAuthAppSettingsBuilder();
        builder.bundleName("agorava2");
        OAuthAppSettings settings = builder.build();
        Assert.assertEquals(settings.getApiKey(), "ymmud");
        Assert.assertEquals(settings.getApiSecret(), "ymmudSecret");
        Assert.assertEquals(settings.getScope(), "ymmudScope");
        Assert.assertEquals(settings.getCallback(), "undefined/ymmudCallback");
View Full Code Here


    @Test(expected = AgoravaException.class)
    public void testBadBundleBuild() {

        PropertyOAuthAppSettingsBuilder builder = new PropertyOAuthAppSettingsBuilder();
        builder.bundleName("agorava3");
        builder.build();

    }
View Full Code Here

TOP

Related Classes of org.agorava.oauth.settings.PropertyOAuthAppSettingsBuilder

Copyright © 2018 www.massapicom. 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.