use of org.apache.jackrabbit.oak.segment.SegmentReader in project jackrabbit-oak by apache.
the class StandbyTestUtils method mockSegment.
public static Segment mockSegment(UUID uuid, byte[] buffer) {
SegmentStore store = mock(SegmentStore.class);
SegmentIdProvider idProvider = mock(SegmentIdProvider.class);
SegmentReader reader = mock(SegmentReader.class);
long msb = uuid.getMostSignificantBits();
long lsb = uuid.getLeastSignificantBits();
SegmentId id = new SegmentId(store, msb, lsb);
ByteBuffer data = ByteBuffer.wrap(buffer);
return new Segment(idProvider, reader, id, data);
}
Aggregations