Jasper { static Path outputDir(SensorContext sensorContext) { Path path = sensorContext.fileSystem().workDir().toPath().resolve("jsp"); try { Files.createDirectories(path); } catch (IOException ex) { throw new IllegalStateException("Failed to create output dir for jsp files", ex); } return path; }  Collection<GeneratedFile> generateFiles(SensorContext sensorContext, List<File> javaClasspath);  }
@Test void test_outputdir() throws Exception { SensorContextTester ctx = SensorContextTester.create(tempFolder); ctx.fileSystem().setWorkDir(workDir); Files.createFile(workDir.resolve("jsp")); assertThatThrownBy(() -> Jasper.outputDir(ctx)) .isInstanceOf(IllegalStateException.class) .hasMessage("Failed to create output dir for jsp files"); }