class PostmanService {

    String toCucumberId(String[] path) {
        // Remove functionalities prefixes for each folder, sub-folder and request
        String[] withoutFunctionalities = new String[path.length];
        for (int i = 0; i < withoutFunctionalities.length; i++) {
            withoutFunctionalities[i] = ScenarioExtractorUtil.removeFunctionalitiesFromScenarioName(path[i]);
        }

        // Join as one ID
        String id = String.join("/", withoutFunctionalities);

        // If the result is too long, take only the last characters, as they are more likely to be unique
        // (most requests would start with the same folder hierarchy)
        if (id.length() > ExecutedScenario.CUCUMBER_ID_MAX_SIZE) {
            id = id.substring(id.length() - ExecutedScenario.CUCUMBER_ID_MAX_SIZE);
        }
        return id;
    }

}