Esp3Connection extends AbstractConnection<Esp3Packet, Esp3Request> implements Esp3ProcessorListener { @Override public void radioTelegramReceived(EspRadioTelegram telegram) { if(radioListener != null) { radioListener.radioTelegramReceived(telegram); } } Esp3Connection(EspProcessor<Esp3Packet> processor, RadioTelegramListener listener); @Override void radioTelegramReceived(EspRadioTelegram telegram);  }
@Test public void testRadioTelegramListener() throws Exception { Esp3Connection conn = new Esp3Connection(mockProcessor, mockListener); Esp31BSTelegram telegram = new Esp31BSTelegram(DeviceID.fromString("0xFF800000"), (byte)0x00, (byte)0x00); Assert.assertNull(mockListener.receivedTelegram); conn.radioTelegramReceived(telegram); Assert.assertEquals(telegram.getSenderID(), mockListener.receivedTelegram.getSenderID()); Assert.assertEquals(telegram.getRORG(), mockListener.receivedTelegram.getRORG()); Assert.assertArrayEquals(telegram.getPayload(), mockListener.receivedTelegram.getPayload()); Assert.assertEquals(telegram.getStatusByte(), mockListener.receivedTelegram.getStatusByte()); }