@Test
public void test() throws IOException {
PipeReducer pipeReducer = new MockPipeReducer();
pipeReducer.configure(new JobConf());
HBaseJSONOutputReader outputReader = new HBaseJSONOutputReader();
outputReader.initialize(pipeReducer);
assertTrue(outputReader.readKeyValue());
//first key value
ImmutableBytesWritable expectedKey1 = new ImmutableBytesWritable(keyString1.getBytes("UTF-8"));
assertEquals(expectedKey1, outputReader.getCurrentKey());
BatchUpdate expectedValue1 = new BatchUpdate(keyString1);
expectedValue1.put(column1, new byte[] {49, 57});
assertEquals(0, expectedValue1.compareTo(outputReader.getCurrentValue())); //no equals
assertTrue(outputReader.readKeyValue());
//second one
ImmutableBytesWritable expectedKey2 = new ImmutableBytesWritable(keyString2.getBytes("UTF-8"));
assertEquals(expectedKey2, outputReader.getCurrentKey());
BatchUpdate expectedValue2 = new BatchUpdate(keyString2);
expectedValue2.put(column2, new byte[] {49, 57});
assertEquals(0, expectedValue2.compareTo(outputReader.getCurrentValue())); //no equals
assertFalse(outputReader.readKeyValue());
}