@Test public void testTransportPacket() { final Transport transport = Mockito.spy(new StubTransport()); final EngineIoSocket socket = new EngineIoSocket(new Object(), ServerYeast.yeast(), new EngineIoServer(), mPingTimeoutHandler); socket.init(transport, null); final Packet<String> packet = new Packet<>(Packet.NOOP); final Emitter.Listener packetListener = Mockito.mock(Emitter.Listener.class); socket.on("packet", packetListener); transport.emit("packet", packet); Mockito.verify(packetListener, Mockito.times(1)) .call(Mockito.eq(packet)); }
void init(Transport transport, @SuppressWarnings("unused") HttpServletRequest initialRequest) { setTransport(transport); onOpen(); }
EngineIoSocket extends Emitter { void init(Transport transport, @SuppressWarnings("unused") HttpServletRequest initialRequest) { setTransport(transport); onOpen(); } }
EngineIoSocket extends Emitter { void init(Transport transport, @SuppressWarnings("unused") HttpServletRequest initialRequest) { setTransport(transport); onOpen(); } EngineIoSocket(Object lockObject, String sid, EngineIoServer server, EngineIoSocketTimeoutHandler pingTimeoutHandler); }
EngineIoSocket extends Emitter { void init(Transport transport, @SuppressWarnings("unused") HttpServletRequest initialRequest) { setTransport(transport); onOpen(); } EngineIoSocket(Object lockObject, String sid, EngineIoServer server, EngineIoSocketTimeoutHandler pingTimeoutHandler); @SuppressWarnings("WeakerAccess") String getId(); @SuppressWarnings("WeakerAccess") ReadyState getReadyState(); void send(Packet<?> packet); void close(); }
EngineIoSocket extends Emitter { void init(Transport transport, @SuppressWarnings("unused") HttpServletRequest initialRequest) { setTransport(transport); onOpen(); } EngineIoSocket(Object lockObject, String sid, EngineIoServer server, EngineIoSocketTimeoutHandler pingTimeoutHandler); @SuppressWarnings("WeakerAccess") String getId(); @SuppressWarnings("WeakerAccess") ReadyState getReadyState(); void send(Packet<?> packet); void close();  }