class FileNameService {

    String generateReportFileName(final String scenarioName, final String extension) {
        final String truncatedScenarioName = StringUtils.left(scenarioName, MAX_SCENARIO_NAME_LENGTH);
        final String safeScenarioName = truncatedScenarioName.replace(' ', '-').replaceAll("[^a-zA-Z0-9\\-]", "");
        final String formattedDate = new SimpleDateFormat(HUMAN_AND_MACHINE_READABLE_TIMESTAMP_PATTERN).format(dateService.now());
        return formattedDate + "-" + safeScenarioName + (StringUtils.isEmpty(extension) ? "" : ("." + extension));
    }

}