FixedNameCsvFileProvider implements CsvFileProvider { @Override public File getFile(File directory, String metricName) { return new File(directory, sanitize(metricName) + ".csv"); }  @Override File getFile(File directory, String metricName);  }
@Test public void testGetFile() { FixedNameCsvFileProvider provider = new FixedNameCsvFileProvider(); File file = provider.getFile(dataDirectory, "test"); assertThat(file.getParentFile()).isEqualTo(dataDirectory); assertThat(file.getName()).isEqualTo("test.csv"); }
@Test public void testGetFileSanitize() { FixedNameCsvFileProvider provider = new FixedNameCsvFileProvider(); File file = provider.getFile(dataDirectory, "/myfake/uri"); assertThat(file.getParentFile()).isEqualTo(dataDirectory); assertThat(file.getName()).isEqualTo("myfake.uri.csv"); }