use of com.tvd12.ezyfoxserver.socket.EzySimpleSocketRequest in project ezyfox-server by youngmonkeys.
the class EzySessionTicketsRequestQueuesTest method addSystemRequestWithEmptyQueue.
@Test
public void addSystemRequestWithEmptyQueue() {
// given
EzySession session = mock(EzySession.class);
EzyArray data = EzyEntityArrays.newArray(EzyCommand.APP_ACCESS.getId(), EzyEmptyObject.getInstance());
EzySocketRequest socketRequest = new EzySimpleSocketRequest(session, data);
EzyRequestQueue queue = mock(EzyRequestQueue.class);
when(queue.isEmpty()).thenReturn(true);
when(session.getSystemRequestQueue()).thenReturn(queue);
EzySessionTicketsRequestQueues sut = new EzySessionTicketsRequestQueues();
// when
boolean result = sut.addRequest(socketRequest);
// then
Asserts.assertFalse(result);
Asserts.assertTrue(sut.getSystemQueue().isEmpty());
}
use of com.tvd12.ezyfoxserver.socket.EzySimpleSocketRequest in project ezyfox-server by youngmonkeys.
the class EzySimpleSocketRequestTest method test.
@Test
public void test() {
EzyAbstractSession session = spy(EzyAbstractSession.class);
EzyArray data = EzyEntityFactory.newArrayBuilder().append(EzyCommand.APP_ACCESS.getId()).build();
EzySimpleSocketRequest request = new EzySimpleSocketRequest(session, data);
assert request.isSystemRequest();
}
Aggregations