Add test for #234 - Not-trimmed values in configuration properties

This commit is contained in:
rbygrave
2015-01-29 22:29:02 +13:00
parent 71e7baff01
commit 36dd2bbee7
@@ -17,6 +17,23 @@ public class PropertiesWrapperTest {
assertEquals("myserver", pw.getServerName());
}
@Test
public void testTrimPropertyValues() {
Properties properties = new Properties();
properties.put("someBasic"," hello ");
properties.put("someInt"," 42 ");
properties.put("noTrimReqr","jim");
properties.put("includeSpaces"," jim bob ");
PropertiesWrapper pw = new PropertiesWrapper("pref", "myserver", properties);
assertEquals("hello",pw.get("someBasic"));
assertEquals(42, pw.getInt("someInt", 1));
assertNull(pw.get("doesNotExist", null));
assertEquals("jim",pw.get("noTrimReqr"));
assertEquals("jim bob",pw.get("includeSpaces"));
}
@Test
public void testGetProperties() throws Exception {