@Test public void testOnError() { final TestTransport transport = Mockito.spy(new TestTransport()); transport.on("error", args -> { }); transport.onError("test", null); Mockito.verify(transport, Mockito.times(1)).emit("error", "test", null); }
protected void onError(String reason, String description) { if(this.listeners("error").size() > 0) { emit("error", reason, description); } }
Transport extends Emitter { protected void onError(String reason, String description) { if(this.listeners("error").size() > 0) { emit("error", reason, description); } } }
Transport extends Emitter { protected void onError(String reason, String description) { if(this.listeners("error").size() > 0) { emit("error", reason, description); } } protected  Transport(); }
Transport extends Emitter { protected void onError(String reason, String description) { if(this.listeners("error").size() > 0) { emit("error", reason, description); } } protected  Transport(); abstract void onRequest(HttpServletRequest request, HttpServletResponse response); abstract void send(List<Packet<?>> packets); abstract boolean isWritable(); abstract String getName(); void close(); }
Transport extends Emitter { protected void onError(String reason, String description) { if(this.listeners("error").size() > 0) { emit("error", reason, description); } } protected  Transport(); abstract void onRequest(HttpServletRequest request, HttpServletResponse response); abstract void send(List<Packet<?>> packets); abstract boolean isWritable(); abstract String getName(); void close();  }