Examples of IGaeUserService


Examples of com.cedarsolutions.server.service.IGaeUserService

    /** Test constructor, getters and setters. */
    @Test public void testConstructor() {
        GaeUserRpc rpc = new GaeUserRpc();
        assertNull(rpc.getGaeUserService());

        IGaeUserService gaeUserService = mock(IGaeUserService.class);
        rpc.setGaeUserService(gaeUserService);
        assertSame(gaeUserService, rpc.getGaeUserService());
    }
View Full Code Here

Examples of com.cedarsolutions.server.service.IGaeUserService

    }

    /** Test the afterPropertiesSet() method. */
    @Test public void testAfterPropertiesSet() throws Exception {
        GaeUserRpc rpc = new GaeUserRpc();
        IGaeUserService gaeUserService = mock(IGaeUserService.class);

        try {
            rpc.setGaeUserService(null);
            rpc.afterPropertiesSet();
            fail("Expected NotConfiguredException");
View Full Code Here

Examples of com.cedarsolutions.server.service.IGaeUserService

        rpc.afterPropertiesSet();
    }

    /** Test getLoginUrl(). */
    @Test public void testGetLoginUrl() {
        IGaeUserService gaeUserService = mock(IGaeUserService.class);
        GaeUserRpc rpc = new GaeUserRpc();
        rpc.setGaeUserService(gaeUserService);

        when(gaeUserService.getLoginUrl(OpenIdProvider.GOOGLE, "dest")).thenReturn("whatever");
        assertEquals("whatever", rpc.getLoginUrl(OpenIdProvider.GOOGLE, "dest"));
    }
View Full Code Here

Examples of com.cedarsolutions.server.service.IGaeUserService

        assertEquals("whatever", rpc.getLoginUrl(OpenIdProvider.GOOGLE, "dest"));
    }

    /** Test getLogoutUrl(). */
    @Test public void testGetLogoutUrl() {
        IGaeUserService gaeUserService = mock(IGaeUserService.class);
        GaeUserRpc rpc = new GaeUserRpc();
        rpc.setGaeUserService(gaeUserService);

        when(gaeUserService.getLogoutUrl("dest")).thenReturn("whatever");
        assertEquals("whatever", rpc.getLogoutUrl("dest"));
    }
View Full Code Here

Examples of com.cedarsolutions.server.service.IGaeUserService

        assertEquals("whatever", rpc.getLogoutUrl("dest"));
    }

    /** Test isUserLoggedIn(). */
    @Test public void testIsUserLoggedIn() {
        IGaeUserService gaeUserService = mock(IGaeUserService.class);
        GaeUserRpc rpc = new GaeUserRpc();
        rpc.setGaeUserService(gaeUserService);

        when(gaeUserService.isUserLoggedIn()).thenReturn(true);
        assertTrue(rpc.isUserLoggedIn());

        when(gaeUserService.isUserLoggedIn()).thenReturn(false);
        assertFalse(rpc.isUserLoggedIn());
    }
View Full Code Here

Examples of com.cedarsolutions.server.service.IGaeUserService

        assertFalse(rpc.isUserLoggedIn());
    }

    /** Test isUserAdmin(). */
    @Test public void testIsUserAdmin() {
        IGaeUserService gaeUserService = mock(IGaeUserService.class);
        GaeUserRpc rpc = new GaeUserRpc();
        rpc.setGaeUserService(gaeUserService);

        when(gaeUserService.isUserAdmin()).thenReturn(true);
        assertTrue(rpc.isUserAdmin());

        when(gaeUserService.isUserAdmin()).thenReturn(false);
        assertFalse(rpc.isUserAdmin());
    }
View Full Code Here

Examples of com.cedarsolutions.server.service.IGaeUserService

        assertFalse(rpc.isUserAdmin());
    }

    /** Test getCurrentUser(). */
    @Test public void testGetCurrentUser() {
        IGaeUserService gaeUserService = mock(IGaeUserService.class);
        GaeUserRpc rpc = new GaeUserRpc();
        rpc.setGaeUserService(gaeUserService);

        FederatedUser user = new FederatedUser();
        when(gaeUserService.getCurrentUser()).thenReturn(user);
        assertSame(user, rpc.getCurrentUser());
    }
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.