IisProjectOrganizationReader implements ProjectOrganizationReader { @Override public JavaRDD<AffMatchProjectOrganization> readProjectOrganizations(JavaSparkContext sc, String inputPath) { return avroLoader.loadJavaRDD(sc, inputPath, ProjectToOrganization.class) .map(srcProjOrg -> converter.convert(srcProjOrg)); }  @Override JavaRDD<AffMatchProjectOrganization> readProjectOrganizations(JavaSparkContext sc, String inputPath); void setAvroLoader(SparkAvroLoader avroLoader); void setProjectOrganizationConverter(ProjectOrganizationConverter converter);  }
@Test(expected = NullPointerException.class) public void readProjectOrganizations_NULL_CONTEXT() { projectOrganizationReader.readProjectOrganizations(null, predefinedPath); }
@Test(expected = NullPointerException.class) public void readProjectOrganizations_NULL_PATH() { projectOrganizationReader.readProjectOrganizations(sparkContext, null); }
@Test public void readProjectOrganizations() throws Exception { JavaRDD<AffMatchProjectOrganization> retProjectOrganization = projectOrganizationReader .readProjectOrganizations(sparkContext, predefinedPath); assertTrue(retProjectOrganization == projectOrganizations); verify(avroLoader).loadJavaRDD(sparkContext, predefinedPath, ProjectToOrganization.class); verify(loadedProjectOrganizations).map(convertProjectOrganizationMapFunction.capture()); assertMapProjectOrganizationFunction(convertProjectOrganizationMapFunction.getValue()); }