SonarQubePythonFile implements PythonFile { public static PythonFile create(InputFile inputFile) { return new Sq62File(inputFile); } private  SonarQubePythonFile(InputFile inputFile); static PythonFile create(InputFile inputFile); @Override String fileName(); InputFile inputFile(); @Override URI uri(); @Override String toString();  }
@Test public void unknown_file() throws Exception { when(inputFile.contents()).thenThrow(new FileNotFoundException()); PythonFile pythonFile = SonarQubePythonFile.create(inputFile); thrown.expect(IllegalStateException.class); pythonFile.content(); }