Search in sources :

Example 1 with EzyRequestHandleException.requestHandleException

use of com.tvd12.ezyfoxserver.exception.EzyRequestHandleException.requestHandleException in project ezyfox-server by youngmonkeys.

the class EzyRequestHandleExceptionTest method test2.

@Test
public void test2() {
    EzySession session = Mockito.mock(EzySession.class);
    Mockito.when(session.getName()).thenReturn("hello world");
    EzyRequestHandleException exception = EzyRequestHandleException.requestHandleException(session, EzyCommand.LOGIN, new Object(), new Exception());
    assert exception.getSession() == session;
    assert exception.getCommand() == EzyCommand.LOGIN;
    assert exception.getData() != null;
}
Also used : EzyRequestHandleException(com.tvd12.ezyfoxserver.exception.EzyRequestHandleException) EzySession(com.tvd12.ezyfoxserver.entity.EzySession) EzyRequestHandleException(com.tvd12.ezyfoxserver.exception.EzyRequestHandleException) BaseTest(com.tvd12.test.base.BaseTest) Test(org.testng.annotations.Test)

Example 2 with EzyRequestHandleException.requestHandleException

use of com.tvd12.ezyfoxserver.exception.EzyRequestHandleException.requestHandleException in project ezyfox-server by youngmonkeys.

the class EzyRequestHandleExceptionTest method test.

@Test(expectedExceptions = { EzyRequestHandleException.class })
public void test() {
    EzySession session = Mockito.mock(EzySession.class);
    Mockito.when(session.getName()).thenReturn("hello world");
    throw EzyRequestHandleException.requestHandleException(session, EzyCommand.LOGIN, new Object(), new Exception());
}
Also used : EzySession(com.tvd12.ezyfoxserver.entity.EzySession) EzyRequestHandleException(com.tvd12.ezyfoxserver.exception.EzyRequestHandleException) BaseTest(com.tvd12.test.base.BaseTest) Test(org.testng.annotations.Test)

Aggregations

EzySession (com.tvd12.ezyfoxserver.entity.EzySession)2 EzyRequestHandleException (com.tvd12.ezyfoxserver.exception.EzyRequestHandleException)2 BaseTest (com.tvd12.test.base.BaseTest)2 Test (org.testng.annotations.Test)2