Search in sources :

Example 1 with Signature

use of com.blade.mvc.hook.Signature in project blade by biezhi.

the class MiddlewareTest method testAuthMiddleware.

@Test
public void testAuthMiddleware() throws Exception {
    BasicAuthMiddleware basicAuthMiddleware = mock(BasicAuthMiddleware.class);
    Signature signature = mock(Signature.class);
    basicAuthMiddleware.before(signature.routeContext());
    basicAuthMiddleware.after(signature.routeContext());
    verify(basicAuthMiddleware).before(signature.routeContext());
    verify(basicAuthMiddleware).after(signature.routeContext());
}
Also used : BasicAuthMiddleware(com.blade.security.web.auth.BasicAuthMiddleware) Signature(com.blade.mvc.hook.Signature) Test(org.junit.Test)

Example 2 with Signature

use of com.blade.mvc.hook.Signature in project blade by biezhi.

the class MiddlewareTest method testMiddleware.

@Test
public void testMiddleware() throws Exception {
    WebHook middleware = mock(WebHook.class);
    Signature signature = mock(Signature.class);
    middleware.before(signature.routeContext());
    middleware.after(signature.routeContext());
    verify(middleware).before(signature.routeContext());
    verify(middleware).after(signature.routeContext());
}
Also used : Signature(com.blade.mvc.hook.Signature) WebHook(com.blade.mvc.hook.WebHook) Test(org.junit.Test)

Aggregations

Signature (com.blade.mvc.hook.Signature)2 Test (org.junit.Test)2 WebHook (com.blade.mvc.hook.WebHook)1 BasicAuthMiddleware (com.blade.security.web.auth.BasicAuthMiddleware)1