Examples of IXsrfTokenService


Examples of com.cedarsolutions.server.service.IXsrfTokenService

*/
public class SecuredServiceExporterTest {

    /** Test the constructor. */
    @Test public void testConstructor() {
        IXsrfTokenService xsrfTokenService = mock(IXsrfTokenService.class);
        SecuredServiceExporter exporter = new SecuredServiceExporter(false, xsrfTokenService);
        assertNotNull(exporter);
        assertFalse(exporter.getEnableXsrfProtection());
        assertFalse(exporter.getShouldCheckPermutationStrongName());
        assertSame(xsrfTokenService, exporter.getXsrfTokenService());
View Full Code Here

Examples of com.cedarsolutions.server.service.IXsrfTokenService

        assertSame(xsrfTokenService, exporter.getXsrfTokenService());
    }

    /** Test doUnexpectedFailure(). */
    @Test public void testDoUnexpectedFailure() {
        IXsrfTokenService xsrfTokenService = mock(IXsrfTokenService.class);
        SecuredServiceExporter exporter = new SecuredServiceExporter(true, xsrfTokenService);
        Exception unexpectedFailure = new Exception("This is a security error, or something like that");

        try {
            exporter.doUnexpectedFailure(unexpectedFailure);
View Full Code Here

Examples of com.cedarsolutions.server.service.IXsrfTokenService

        assertFalse(exporter.getShouldCheckPermutationStrongName());
    }

    /** Test get/setXsrfTokenService(). */
    @Test public void testGetSetSessionCookieName() {
        IXsrfTokenService xsrfTokenService = mock(IXsrfTokenService.class);
        SecuredServiceExporter exporter = new SecuredServiceExporter(false, null);
        assertNull(exporter.getXsrfTokenService());

        exporter.setXsrfTokenService(xsrfTokenService);
        assertSame(xsrfTokenService, exporter.getXsrfTokenService());
View Full Code Here

Examples of com.cedarsolutions.server.service.IXsrfTokenService

        assertNull(exporter.getXsrfTokenService());
    }

    /** Test validateXsrfToken(). */
    @Test public void testValidateXsrfToken() {
        IXsrfTokenService xsrfTokenService = mock(IXsrfTokenService.class);
        SecuredServiceExporter exporter = new SecuredServiceExporter(false, null);
        exporter.setXsrfTokenService(xsrfTokenService);

        RpcToken token = mock(RpcToken.class);
        exporter.validateXsrfToken(token);
View Full Code Here

Examples of com.cedarsolutions.server.service.IXsrfTokenService

        assertNull(factory.getXsrfTokenService());

        factory.setEnableXsrfProtection(true);
        assertTrue(factory.getEnableXsrfProtection());

        IXsrfTokenService xsrfTokenService = mock(IXsrfTokenService.class);
        factory.setXsrfTokenService(xsrfTokenService);
        assertSame(xsrfTokenService, factory.getXsrfTokenService());
    }
View Full Code Here

Examples of com.cedarsolutions.server.service.IXsrfTokenService

        assertSame(xsrfTokenService, factory.getXsrfTokenService());
    }

    /** Test afterPropertiesSet(). */
    @Test public void testAfterPropertiesSet() {
        IXsrfTokenService xsrfTokenService = mock(IXsrfTokenService.class);
        SecuredServiceExporterFactory factory = new SecuredServiceExporterFactory();

        factory.setEnableXsrfProtection(false);
        factory.setXsrfTokenService(xsrfTokenService);
        factory.afterPropertiesSet();
View Full Code Here

Examples of com.cedarsolutions.server.service.IXsrfTokenService

    }

    /** Test create(). */
    @Test public void testCreate() {
        RPCServiceExporter exporter = null;
        IXsrfTokenService xsrfTokenService = mock(IXsrfTokenService.class);
        SecuredServiceExporterFactory factory = new SecuredServiceExporterFactory();

        factory.setEnableXsrfProtection(false);
        factory.setXsrfTokenService(xsrfTokenService);
        exporter = factory.create();
View Full Code Here

Examples of com.cedarsolutions.server.service.IXsrfTokenService

*/
public class XsrfTokenRpcTest {

    /** Test constructor, getters and setters. */
    @Test public void testConstructorGettersSetters() {
        IXsrfTokenService xsrfTokenService = mock(IXsrfTokenService.class);

        XsrfTokenRpc rpc = new XsrfTokenRpc();
        assertNull(rpc.getXsrfTokenService());

        rpc.setXsrfTokenService(xsrfTokenService);
View Full Code Here

Examples of com.cedarsolutions.server.service.IXsrfTokenService

        assertSame(xsrfTokenService, rpc.getXsrfTokenService());
    }

    /** Test afterPropertiesSet(). */
    @Test public void testAfterPropertieSet() {
        IXsrfTokenService xsrfTokenService = mock(IXsrfTokenService.class);
        XsrfTokenRpc rpc = new XsrfTokenRpc();

        rpc.setXsrfTokenService(xsrfTokenService);
        rpc.afterPropertiesSet();

View Full Code Here

Examples of com.cedarsolutions.server.service.IXsrfTokenService

        } catch (NotConfiguredException e) { }
    }

    /** Test generateXsrfToken(). */
    @Test public void testGenerateXsrfToken() {
        IXsrfTokenService xsrfTokenService = mock(IXsrfTokenService.class);
        when(xsrfTokenService.generateXsrfToken()).thenReturn("Hello");
        XsrfTokenRpc rpc = new XsrfTokenRpc();
        rpc.setXsrfTokenService(xsrfTokenService);
        assertEquals("Hello", rpc.generateXsrfToken());
    }
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.