Search in sources :

Example 1 with EzySimplePingRequest

use of com.tvd12.ezyfoxserver.request.EzySimplePingRequest in project ezyfox-server by youngmonkeys.

the class EzyPingControllerTest method test.

@SuppressWarnings("rawtypes")
@Test
public void test() {
    EzyPingController controller = new EzyPingController();
    EzyServerContext serverContext = mock(EzyServerContext.class);
    EzySimplePingRequest request = new EzySimplePingRequest();
    controller.handle(serverContext, request);
    EzySimpleSettings settings = new EzySimpleSettings();
    EzyServer server = mock(EzyServer.class);
    when(server.getSettings()).thenReturn(settings);
    when(serverContext.getServer()).thenReturn(server);
    assert MethodInvoker.create().object(controller).method("getSettings").param(EzyServerContext.class, serverContext).invoke() == settings;
    EzySessionManager sessionManager = mock(EzySessionManager.class);
    when(server.getSessionManager()).thenReturn(sessionManager);
    assert MethodInvoker.create().object(controller).method("getSessionManager").param(EzyServerContext.class, serverContext).invoke() == sessionManager;
    EzyZoneContext zoneContext = mock(EzyZoneContext.class);
    EzyZone zone = mock(EzyZone.class);
    when(zoneContext.getZone()).thenReturn(zone);
    EzyZoneUserManager zoneUserManager = mock(EzyZoneUserManager.class);
    when(zone.getUserManager()).thenReturn(zoneUserManager);
    assert MethodInvoker.create().object(controller).method("getUserManager").param(EzyZoneContext.class, zoneContext).invoke() == zoneUserManager;
}
Also used : EzyZone(com.tvd12.ezyfoxserver.EzyZone) EzyZoneContext(com.tvd12.ezyfoxserver.context.EzyZoneContext) EzyPingController(com.tvd12.ezyfoxserver.controller.EzyPingController) EzyServerContext(com.tvd12.ezyfoxserver.context.EzyServerContext) EzySessionManager(com.tvd12.ezyfoxserver.wrapper.EzySessionManager) EzySimplePingRequest(com.tvd12.ezyfoxserver.request.EzySimplePingRequest) EzySimpleSettings(com.tvd12.ezyfoxserver.setting.EzySimpleSettings) EzyServer(com.tvd12.ezyfoxserver.EzyServer) EzyZoneUserManager(com.tvd12.ezyfoxserver.wrapper.EzyZoneUserManager) Test(org.testng.annotations.Test) BaseTest(com.tvd12.test.base.BaseTest)

Example 2 with EzySimplePingRequest

use of com.tvd12.ezyfoxserver.request.EzySimplePingRequest in project ezyfox-server by youngmonkeys.

the class EzySimplePingRequestTest method test.

@Test
public void test() {
    EzySimplePingRequest rq = new EzySimplePingRequest();
    rq.deserializeParams(null);
    rq.release();
}
Also used : EzySimplePingRequest(com.tvd12.ezyfoxserver.request.EzySimplePingRequest) Test(org.testng.annotations.Test)

Aggregations

EzySimplePingRequest (com.tvd12.ezyfoxserver.request.EzySimplePingRequest)2 Test (org.testng.annotations.Test)2 EzyServer (com.tvd12.ezyfoxserver.EzyServer)1 EzyZone (com.tvd12.ezyfoxserver.EzyZone)1 EzyServerContext (com.tvd12.ezyfoxserver.context.EzyServerContext)1 EzyZoneContext (com.tvd12.ezyfoxserver.context.EzyZoneContext)1 EzyPingController (com.tvd12.ezyfoxserver.controller.EzyPingController)1 EzySimpleSettings (com.tvd12.ezyfoxserver.setting.EzySimpleSettings)1 EzySessionManager (com.tvd12.ezyfoxserver.wrapper.EzySessionManager)1 EzyZoneUserManager (com.tvd12.ezyfoxserver.wrapper.EzyZoneUserManager)1 BaseTest (com.tvd12.test.base.BaseTest)1