diff --git a/src/main/java/org/jenkinsci/plugins/parameterizedscheduler/ParameterParser.java b/src/main/java/org/jenkinsci/plugins/parameterizedscheduler/ParameterParser.java index a867e43..92293e0 100644 --- a/src/main/java/org/jenkinsci/plugins/parameterizedscheduler/ParameterParser.java +++ b/src/main/java/org/jenkinsci/plugins/parameterizedscheduler/ParameterParser.java @@ -34,7 +34,7 @@ public Map parse(String nameValuePairFormattedString) { //the default splitter message in this scenario is not user friendly, so snip a trailing semicolon clean = clean.substring(0, clean.length() - 1); } - return Splitter.on(PAIR_SEPARATOR).trimResults().withKeyValueSeparator(NAME_VALUE_SEPARATOR).split(clean); + return Splitter.on(PAIR_SEPARATOR).trimResults().withKeyValueSeparator(Splitter.on(NAME_VALUE_SEPARATOR).limit(2)).split(clean); } public String checkSanity(String cronTabSpec, ParametersDefinitionProperty parametersDefinitionProperty) { diff --git a/src/test/java/org/jenkinsci/plugins/parameterizedscheduler/ParameterParserTest.java b/src/test/java/org/jenkinsci/plugins/parameterizedscheduler/ParameterParserTest.java index 3be7c38..92ca437 100644 --- a/src/test/java/org/jenkinsci/plugins/parameterizedscheduler/ParameterParserTest.java +++ b/src/test/java/org/jenkinsci/plugins/parameterizedscheduler/ParameterParserTest.java @@ -91,6 +91,15 @@ public void test_TwoParamsStringWithSpaceReturns_emptyMap() { assertEquals(expected, testObject.parse("name2=value2; name=value")); } + @Test + public void test_ValueContainsEquals_emptyMap() { + ParameterParser testObject = new ParameterParser(); + + HashMap expected = new HashMap(); + expected.put("name", "value=contains=equals"); + assertEquals(expected, testObject.parse("name=value=contains=equals")); + } + @Test public void checkSanity_HappyPath() throws Exception { ParameterParser testObject = new ParameterParser();