MsgSetExtendedBolusStop extends MessageBase { @Override public void handleMessage(byte[] bytes) { int result = intFromBuff(bytes, 0, 1); if (result != 1) { failed = true; if (L.isEnabled(L.PUMPCOMM)) log.debug("Set extended bolus stop result: " + result + " FAILED!!!"); } else { if (L.isEnabled(L.PUMPCOMM)) log.debug("Set extended bolus stop result: " + result); } } MsgSetExtendedBolusStop(); @Override void handleMessage(byte[] bytes);  }
@Test public void runTest() { AAPSMocker.mockMainApp(); AAPSMocker.mockApplicationContext(); AAPSMocker.mockSP(); AAPSMocker.mockL(); MsgSetExtendedBolusStop packet = new MsgSetExtendedBolusStop(); packet.handleMessage(createArray(34, (byte) 7)); assertEquals(true, packet.failed); }