Search in sources :

Example 1 with EzyUserRequestInterceptor

use of com.tvd12.ezyfoxserver.support.handler.EzyUserRequestInterceptor in project ezyfox-server by youngmonkeys.

the class EzyUserRequestInterceptorTest method preHandleTest.

@Test
public void preHandleTest() {
    // given
    EzyUserRequestInterceptor<EzyContext> sut = new EzyUserRequestInterceptor<EzyContext>() {
    };
    // when
    // then
    EzyContext context = mock(EzyContext.class);
    EzyUserSessionEvent event = mock(EzyUserSessionEvent.class);
    String command = RandomUtil.randomShortAlphabetString();
    String data = RandomUtil.randomShortAlphabetString();
    sut.preHandle(context, event, data, command);
    sut.postHandle(context, event, data, command);
    Exception e = new Exception("just test");
    sut.postHandle(context, event, data, command, e);
}
Also used : EzyUserSessionEvent(com.tvd12.ezyfoxserver.event.EzyUserSessionEvent) EzyContext(com.tvd12.ezyfoxserver.context.EzyContext) EzyUserRequestInterceptor(com.tvd12.ezyfoxserver.support.handler.EzyUserRequestInterceptor) Test(org.testng.annotations.Test)

Aggregations

EzyContext (com.tvd12.ezyfoxserver.context.EzyContext)1 EzyUserSessionEvent (com.tvd12.ezyfoxserver.event.EzyUserSessionEvent)1 EzyUserRequestInterceptor (com.tvd12.ezyfoxserver.support.handler.EzyUserRequestInterceptor)1 Test (org.testng.annotations.Test)1