@Test
public void readDocuments() throws Exception {

    
    // given
    
    String inputDocumentPath = "/path";
    when(sparkContext.sequenceFile(inputDocumentPath, Writable.class, BytesWritable.class)).thenReturn(rawDocuments);
    doReturn(docWrappers).when(rawDocuments).mapToPair(Mockito.any());
    
    
    // execute
    
    JavaPairRDD<String, DocumentWrapper> retDocWrappers = coansysInputDocumentReader.readDocuments(sparkContext, inputDocumentPath);
    
    
    // assert
    
    assertTrue(docWrappers == retDocWrappers);
    
    verify(sparkContext).sequenceFile(inputDocumentPath, Writable.class, BytesWritable.class);
    
    verify(rawDocuments).mapToPair(convertToDocumentWrapperTuple2Function.capture());
    assertConvertToDocumentWrapperTuple2Function(convertToDocumentWrapperTuple2Function.getValue());
    
}