@Test
public void testWriteToFileOutputsSingleJsonFileIfPresentInSettings() throws Exception {

    String outputPrefix = tempFile.toString();
    OutputSettings settings = OutputSettings.builder()
            .outputPrefix(outputPrefix)
            .outputFormats(EnumSet.of(OutputFormat.JSON))
            .build();
    Analysis analysis = Analysis.builder().build();
    AnalysisResultsWriter.writeToFile(analysis, newAnalysisResults(), settings);
    Path outputPath = Paths.get(String.format("%s.%s", outputPrefix, OutputFormat.JSON.getFileExtension()));
    assertThat(outputPath.toFile().exists(), is(true));
    assertThat(outputPath.toFile().delete(), is(true));
}