MsgHistoryAllDone extends MessageBase { @Override public void handleMessage(byte[] bytes) { received = true; if (L.isEnabled(L.PUMPCOMM)) log.debug("History all done received"); } MsgHistoryAllDone(); @Override void handleMessage(byte[] bytes); static boolean received; }
@Test public void runTest() { AAPSMocker.mockMainApp(); AAPSMocker.mockApplicationContext(); AAPSMocker.mockSP(); AAPSMocker.mockL(); MsgHistoryAllDone packet = new MsgHistoryAllDone(); packet.handleMessage(createArray(34, (byte) 1)); assertEquals(true, packet.received); }