@Test public void readDocumentProjects() throws Exception { when(avroLoader.loadJavaRDD(sparkContext, inputDocProjPath, DocumentToProject.class)).thenReturn(documentToProjectRdd); doReturn(documentProjects).when(documentToProjectRdd).map(any()); JavaRDD<AffMatchDocumentProject> retDocumentProjects = documentProjectReader.readDocumentProjects(sparkContext, inputDocProjPath); assertTrue(retDocumentProjects == documentProjects); verify(avroLoader).loadJavaRDD(sparkContext, inputDocProjPath, DocumentToProject.class); verify(documentToProjectRdd).map(convertDocumentProjectFunction.capture()); assertConvertDocumentProjectFunction(convertDocumentProjectFunction.getValue()); }
@Override public JavaRDD<AffMatchDocumentProject> readDocumentProjects(JavaSparkContext sc, String inputPath) { Preconditions.checkNotNull(sc); Preconditions.checkArgument(StringUtils.isNotBlank(inputPath)); return avroLoader.loadJavaRDD(sc, inputPath, DocumentToProject.class) .map(docProj -> converter.convert(docProj)); }
IisDocumentProjectReader implements DocumentProjectReader { @Override public JavaRDD<AffMatchDocumentProject> readDocumentProjects(JavaSparkContext sc, String inputPath) { Preconditions.checkNotNull(sc); Preconditions.checkArgument(StringUtils.isNotBlank(inputPath)); return avroLoader.loadJavaRDD(sc, inputPath, DocumentToProject.class) .map(docProj -> converter.convert(docProj)); } }
IisDocumentProjectReader implements DocumentProjectReader { @Override public JavaRDD<AffMatchDocumentProject> readDocumentProjects(JavaSparkContext sc, String inputPath) { Preconditions.checkNotNull(sc); Preconditions.checkArgument(StringUtils.isNotBlank(inputPath)); return avroLoader.loadJavaRDD(sc, inputPath, DocumentToProject.class) .map(docProj -> converter.convert(docProj)); }  }
IisDocumentProjectReader implements DocumentProjectReader { @Override public JavaRDD<AffMatchDocumentProject> readDocumentProjects(JavaSparkContext sc, String inputPath) { Preconditions.checkNotNull(sc); Preconditions.checkArgument(StringUtils.isNotBlank(inputPath)); return avroLoader.loadJavaRDD(sc, inputPath, DocumentToProject.class) .map(docProj -> converter.convert(docProj)); }  @Override JavaRDD<AffMatchDocumentProject> readDocumentProjects(JavaSparkContext sc, String inputPath); }
IisDocumentProjectReader implements DocumentProjectReader { @Override public JavaRDD<AffMatchDocumentProject> readDocumentProjects(JavaSparkContext sc, String inputPath) { Preconditions.checkNotNull(sc); Preconditions.checkArgument(StringUtils.isNotBlank(inputPath)); return avroLoader.loadJavaRDD(sc, inputPath, DocumentToProject.class) .map(docProj -> converter.convert(docProj)); }  @Override JavaRDD<AffMatchDocumentProject> readDocumentProjects(JavaSparkContext sc, String inputPath);  }