MsgSetHistoryEntry_v2 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 history entry result: " + result + " FAILED!!!"); } else { if (L.isEnabled(L.PUMPCOMM)) log.debug("Set history entry result: " + result); } } MsgSetHistoryEntry_v2();  MsgSetHistoryEntry_v2(int type, long time, int param1, int param2); @Override void handleMessage(byte[] bytes);  }
@Test public void runTest() { MsgSetHistoryEntry_v2 initializerTest = new MsgSetHistoryEntry_v2((byte) 1, System.currentTimeMillis(), 1, 0); MsgSetHistoryEntry_v2 packet = new MsgSetHistoryEntry_v2(); packet.handleMessage(createArray(34, (byte) 2)); assertEquals(true, packet.failed); packet = new MsgSetHistoryEntry_v2(); packet.handleMessage(createArray(34, (byte) 1)); assertEquals(false, packet.failed); }