Properly handle values with spaces

Closes gh-10741
This commit is contained in:
Stephane Nicoll
2018-04-24 16:26:51 +02:00
parent d4729f5389
commit fd47b728c1
4 changed files with 15 additions and 10 deletions

View File

@@ -40,7 +40,7 @@ public class SystemPropertyFormatterTests {
@Test
public void parseKeyWithValue() {
assertThat(SystemPropertyFormatter.format("key1", "value1"))
.isEqualTo("-Dkey1=value1");
.isEqualTo("-Dkey1=\"value1\"");
}
@Test
@@ -48,4 +48,10 @@ public class SystemPropertyFormatterTests {
assertThat(SystemPropertyFormatter.format("key1", "")).isEqualTo("-Dkey1");
}
@Test
public void parseKeyWithOnlySpace() {
assertThat(SystemPropertyFormatter.format("key1", " "))
.isEqualTo("-Dkey1=\" \"");
}
}