when(pos.getSchema()).thenReturn(new Schema(new Schema.FieldSchema("blah", (byte) 55)));
return pos;
}
private InterStorage getInterStorage(List<String> returnRecords) throws IOException {
InterStorage is = mock(InterStorage.class);
when(is.getInputFormat()).thenReturn(new InterInputFormat());
List<Tuple> tuples = new LinkedList<Tuple>();
for (String record : returnRecords) {
Tuple tup = mock(Tuple.class);
when(tup.toDelimitedString(OutputSampler.DELIMITER)).thenReturn(record);
tuples.add(tup);
}
tuples.add(null);
when(is.getNext()).thenReturn(tuples.remove(0), tuples.toArray(new Tuple[0]));
return is;
}