### Question:
DeepSparkContext extends JavaSparkContext implements Serializable { public RDD textFile(ExtractorConfig<Cells> config) throws IllegalArgumentException { if(ExtractorConstants.HDFS.equals(config.getExtractorImplClassName())) { return createHDFSRDD(config); } else if(ExtractorConstants.S3.equals(config.getExtractorImplClassName())) { return createS3RDD(config); } throw new IllegalArgumentException("Valid configurations are HDFS paths, S3 paths or local file paths."); } DeepSparkContext(SparkContext sc);  DeepSparkContext(String master, String appName);  DeepSparkContext(String master, String appName, String sparkHome, String jarFile);  DeepSparkContext(String master, String appName, String sparkHome, String[] jars);  DeepSparkContext(String master, String appName, String sparkHome, String[] jars,
                            Map<String, String> environment);  DeepSparkContext(DeepSparkConfig deepSparkConfig); @Override SparkContext sc(); RDD<T> createRDD(ExtractorConfig<T> config); RDD<T> createRDD(DeepJobConfig<T, ?> deepJobConfig); JavaRDD<T> createJavaRDD(
            ExtractorConfig<T> config); JavaRDD<T> createJavaRDD(DeepJobConfig<T, ?> config); static JavaRDD<Row> createJavaRowRDD(JavaRDD<Cells> cellsRDD); DataFrame createJavaSchemaRDD(ExtractorConfig<Cells> config); DataFrame sql(String query); static void saveRDD(RDD<T> rdd, S config, UpdateQueryBuilder queryBuilder); static void saveRDD(RDD<T> rdd, S config); SQLContext getSQLContext(); RDD textFile(ExtractorConfig<Cells> config); RDD<Cells> createHDFSRDD(ExtractorConfig<Cells> config); RDD<Cells> createS3RDD(ExtractorConfig<Cells> config);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void textFileInvalidConfig() throws Exception { deepSparkContext = createDeepSparkContext(); DeepSparkContext deepSparkContextSpy = PowerMockito.spy(deepSparkContext); SQLContext sqlContext = mock(SQLContext.class); Whitebox.setInternalState(deepSparkContextSpy, "sc", sparkContext); Whitebox.setInternalState(deepSparkContextSpy, "sqlContext", sqlContext); ExtractorConfig<Cells> config = mock(ExtractorConfig.class); deepSparkContextSpy.textFile(config); }