MsgSettingActiveProfile extends MessageBase { public void handleMessage(byte[] bytes) { DanaRPump.getInstance().activeProfile = intFromBuff(bytes, 0, 1); if (L.isEnabled(L.PUMPCOMM)) log.debug("Active profile number: " + DanaRPump.getInstance().activeProfile); } MsgSettingActiveProfile(); void handleMessage(byte[] bytes);  }
@Test public void runTest() { AAPSMocker.mockMainApp(); AAPSMocker.mockApplicationContext(); AAPSMocker.mockSP(); AAPSMocker.mockL(); MsgSettingActiveProfile packet = new MsgSettingActiveProfile(); packet.handleMessage(createArray(34, (byte) 7)); DanaRPump pump = DanaRPump.getInstance(); assertEquals(MessageBase.intFromBuff(createArray(34, (byte) 7), 0, 1), pump.activeProfile); }