LilyHBaseEventPublisher extends HBaseEventPublisher { @Override public void publishEvent(byte[] row, byte[] payload) throws IOException { Put messagePut = new Put(row); messagePut.add(RecordCf.DATA.bytes, RecordColumn.PAYLOAD.bytes, 1L, payload); boolean rowIsPut = getPayloadTable() .checkAndPut(row, RecordCf.DATA.bytes, RecordColumn.DELETED.bytes, FALSE_BYTES, messagePut); if (! rowIsPut) LogFactory.getLog(getClass()).warn("Did not publish event as requested, row=" + Arrays.toString(row)); } LilyHBaseEventPublisher(HTableInterface recordTable); @Override void publishEvent(byte[] row, byte[] payload);  }
@Test public void testProcessMessage_RowInRepository() throws IOException { byte[] messageRow = Bytes.toBytes("row-id"); byte[] messagePayload = Bytes.toBytes("payload"); Put expectedPut = new Put(messageRow); expectedPut.add(RecordCf.DATA.bytes, RecordColumn.PAYLOAD.bytes, messagePayload); eventPublisher.publishEvent(messageRow, messagePayload); verify(recordTable).checkAndPut(aryEq(messageRow), aryEq(RecordCf.DATA.bytes), aryEq(RecordColumn.DELETED.bytes), aryEq(Bytes.toBytes(false)), any(Put.class)); }