use of com.tvd12.ezyfoxserver.command.EzyPluginSendResponse in project ezyfox-server by youngmonkeys.
the class EzySimplePluginContextTest method sendMultiTest.
@Test
public void sendMultiTest() {
// given
EzyData data = mock(EzyData.class);
EzySession recipient = mock(EzySession.class);
List<EzySession> recipients = Collections.singletonList(recipient);
boolean encrypted = RandomUtil.randomBoolean();
EzyPluginSendResponse sendResponse = mock(EzyPluginSendResponse.class);
doNothing().when(sendResponse).execute(data, recipients, encrypted, EzyTransportType.TCP);
EzySimplePluginContext sut = new EzySimplePluginContext();
FieldUtil.setFieldValue(sut, "sendResponse", sendResponse);
// when
sut.send(data, recipients, encrypted, EzyTransportType.TCP);
// then
verify(sendResponse, times(1)).execute(data, recipients, encrypted, EzyTransportType.TCP);
}
Aggregations