GsonRecordReader extends RecordReader<LongWritable, JsonObject> { @Override public JsonObject getCurrentValue() { return currentValue; }  @Override void initialize(InputSplit genericSplit, TaskAttemptContext context); @Override boolean nextKeyValue(); @Override LongWritable getCurrentKey(); @Override JsonObject getCurrentValue(); @Override float getProgress(); @Override void close();  }
@Test public void testGetCurrentValue() throws Exception { JsonParser jsonParser = new JsonParser(); JsonObject json1 = (JsonObject) jsonParser.parse(value1.toString()); JsonObject json2 = (JsonObject) jsonParser.parse(value2.toString()); GsonRecordReader multipleRecordReader = getRecordReader(60); assertThat(multipleRecordReader.nextKeyValue()).isTrue(); assertThat(multipleRecordReader.getCurrentValue()).isEqualTo(json1); assertThat(multipleRecordReader.nextKeyValue()).isTrue(); assertThat(multipleRecordReader.getCurrentValue()).isEqualTo(json2); assertThat(multipleRecordReader.nextKeyValue()).isFalse(); assertThat(multipleRecordReader.getCurrentValue()).isEqualTo(json2); multipleRecordReader.close(); }