From 36dd2bbee76b3338b7bf2afc20d21810156aec08 Mon Sep 17 00:00:00 2001 From: rbygrave Date: Thu, 29 Jan 2015 22:29:02 +1300 Subject: [PATCH] Add test for #234 - Not-trimmed values in configuration properties --- .../ebean/config/PropertiesWrapperTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/test/java/com/avaje/ebean/config/PropertiesWrapperTest.java b/src/test/java/com/avaje/ebean/config/PropertiesWrapperTest.java index 7b80313d3..117c6ee77 100644 --- a/src/test/java/com/avaje/ebean/config/PropertiesWrapperTest.java +++ b/src/test/java/com/avaje/ebean/config/PropertiesWrapperTest.java @@ -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 {