### Question:
PostmanService { String toCollectionFileName(Source source, String newmanReportPath) { if (source.isPostmanCountryRootFolders()) { return newmanReportPath.replaceAll("_[a-z]{2,3}(\\+[a-z]{2,3})*.json$", ".json"); } return newmanReportPath; }  void parse(JsonParser parser, NewmanParsingResult result); List<ExecutedScenario> postProcess(Run run, NewmanParsingResult result, String newmanReportPath, AtomicInteger requestPosition); void deleteTempFiles(NewmanParsingResult newmanParsingResult); static final String FOLDER_DELIMITER; }### Answer:
@Test public void toCollectionFileName_ShouldRemoveCountryCodes_WhenSourceRequiresIt() { com.decathlon.ara.domain.Source sourceWithCountries = new com.decathlon.ara.domain.Source() .withPostmanCountryRootFolders(true); assertThat(cut.toCollectionFileName(sourceWithCountries, "file.json")).isEqualTo("file.json"); assertThat(cut.toCollectionFileName(sourceWithCountries, "file_all.json")).isEqualTo("file.json"); assertThat(cut.toCollectionFileName(sourceWithCountries, "file_cn.json")).isEqualTo("file.json"); assertThat(cut.toCollectionFileName(sourceWithCountries, "file_be+cn.json")).isEqualTo("file.json"); assertThat(cut.toCollectionFileName(sourceWithCountries, "file_all+be+cn.json")).isEqualTo("file.json"); assertThat(cut.toCollectionFileName(sourceWithCountries, "file_a.json")).isEqualTo("file_a.json"); assertThat(cut.toCollectionFileName(sourceWithCountries, "file_alli.json")).isEqualTo("file_alli.json"); assertThat(cut.toCollectionFileName(sourceWithCountries, "file_AA.json")).isEqualTo("file_AA.json"); assertThat(cut.toCollectionFileName(sourceWithCountries, "file_a1.json")).isEqualTo("file_a1.json"); assertThat(cut.toCollectionFileName(sourceWithCountries, "file_AA+bb.json")).isEqualTo("file_AA+bb.json"); assertThat(cut.toCollectionFileName(sourceWithCountries, "file.postman_collection.json")).isEqualTo("file.postman_collection.json"); assertThat(cut.toCollectionFileName(sourceWithCountries, "file.postman_collection_all.json")).isEqualTo("file.postman_collection.json"); }
@Test public void toCollectionFileName_ShouldNotRemoveCountryCodes_WhenSourceDoesNotRequireIt() { com.decathlon.ara.domain.Source sourceWithoutCountries = new com.decathlon.ara.domain.Source() .withPostmanCountryRootFolders(false); assertThat(cut.toCollectionFileName(sourceWithoutCountries, "file.json")).isEqualTo("file.json"); assertThat(cut.toCollectionFileName(sourceWithoutCountries, "file_all.json")).isEqualTo("file_all.json"); assertThat(cut.toCollectionFileName(sourceWithoutCountries, "file_cn.json")).isEqualTo("file_cn.json"); assertThat(cut.toCollectionFileName(sourceWithoutCountries, "file_be+cn.json")).isEqualTo("file_be+cn.json"); assertThat(cut.toCollectionFileName(sourceWithoutCountries, "file_all+be+cn.json")).isEqualTo("file_all+be+cn.json"); assertThat(cut.toCollectionFileName(sourceWithoutCountries, "file.postman_collection.json")).isEqualTo("file.postman_collection.json"); }