Search in sources :

Example 1 with EzySendResponse

use of com.tvd12.ezyfoxserver.command.EzySendResponse in project ezyfox-server by youngmonkeys.

the class EzySimpleServerContextTest method sendNowTest.

@Test
public void sendNowTest() {
    // given
    EzyResponse response = mock(EzyResponse.class);
    EzySession recipient = mock(EzySession.class);
    EzySendResponse sendResponse = mock(EzySendResponse.class);
    doNothing().when(sendResponse).execute(response, recipient, false, true, EzyTransportType.TCP);
    EzySimpleServerContext sut = new EzySimpleServerContext();
    FieldUtil.setFieldValue(sut, "sendResponse", sendResponse);
    // when
    sut.sendNow(response, recipient);
    // then
    verify(sendResponse, times(1)).execute(response, recipient, false, true, EzyTransportType.TCP);
}
Also used : EzySimpleServerContext(com.tvd12.ezyfoxserver.context.EzySimpleServerContext) EzyResponse(com.tvd12.ezyfoxserver.response.EzyResponse) EzySession(com.tvd12.ezyfoxserver.entity.EzySession) EzySendResponse(com.tvd12.ezyfoxserver.command.EzySendResponse) BaseCoreTest(com.tvd12.ezyfoxserver.testing.BaseCoreTest) Test(org.testng.annotations.Test)

Aggregations

EzySendResponse (com.tvd12.ezyfoxserver.command.EzySendResponse)1 EzySimpleServerContext (com.tvd12.ezyfoxserver.context.EzySimpleServerContext)1 EzySession (com.tvd12.ezyfoxserver.entity.EzySession)1 EzyResponse (com.tvd12.ezyfoxserver.response.EzyResponse)1 BaseCoreTest (com.tvd12.ezyfoxserver.testing.BaseCoreTest)1 Test (org.testng.annotations.Test)1