Skip to content

Commit

Permalink
Fix problem when an env variable value contains special characters
Browse files Browse the repository at this point in the history
  • Loading branch information
zxBCN Farre_Basurte,Juan_Antonio (IT EDS) EXTERNAL committed Jul 27, 2020
1 parent 2d99279 commit 2804e06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/test/groovy/org/ods/e2e/util/SpecHelper.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package org.ods.e2e.util
import groovy.json.JsonSlurperClassic
import kong.unirest.Unirest

import java.util.regex.Matcher
import java.util.regex.Pattern

class SpecHelper {
Expand All @@ -26,7 +27,7 @@ class SpecHelper {
println "ERROR: Missing properties in configuration $match[0]"
raiseError = true
} else {
value = value.replaceAll(Pattern.quote(nameToReplace), valueToReplace)
value = value.replaceAll(Pattern.quote(nameToReplace), Matcher.quoteReplacement(valueToReplace))
properties[key] = value
}
}
Expand Down

0 comments on commit 2804e06

Please sign in to comment.