Search in sources :

Example 1 with CsrfMiddleware

use of com.blade.security.web.csrf.CsrfMiddleware in project blade by biezhi.

the class BladeTest method testUse.

@Test
public void testUse() {
    Blade blade = Blade.of().use(new CsrfMiddleware());
    List<WebHook> middleware = blade.middleware();
    Assert.assertNotNull(middleware);
    assertEquals(1, middleware.size());
}
Also used : CsrfMiddleware(com.blade.security.web.csrf.CsrfMiddleware) WebHook(com.blade.mvc.hook.WebHook) Test(org.junit.Test)

Example 2 with CsrfMiddleware

use of com.blade.security.web.csrf.CsrfMiddleware in project tale by otale.

the class Application method main.

public static void main(String[] args) {
    Blade blade = Blade.of();
    TaleLoader.init(blade);
    blade.use(new CsrfMiddleware()).start(Application.class, args);
}
Also used : CsrfMiddleware(com.blade.security.web.csrf.CsrfMiddleware) Blade(com.blade.Blade)

Example 3 with CsrfMiddleware

use of com.blade.security.web.csrf.CsrfMiddleware in project tale by otale.

the class BladeTestRunner method withBeforeClasses.

@Override
protected Statement withBeforeClasses(final Statement statement) {
    final Statement junitStatement = super.withBeforeClasses(statement);
    return new Statement() {

        @Override
        public void evaluate() throws Throwable {
            blade = Blade.me();
            blade.use(new CsrfMiddleware()).start(mainCls).await();
            junitStatement.evaluate();
        }
    };
}
Also used : CsrfMiddleware(com.blade.security.web.csrf.CsrfMiddleware) Statement(org.junit.runners.model.Statement)

Aggregations

CsrfMiddleware (com.blade.security.web.csrf.CsrfMiddleware)3 Blade (com.blade.Blade)1 WebHook (com.blade.mvc.hook.WebHook)1 Test (org.junit.Test)1 Statement (org.junit.runners.model.Statement)1