MigrationProperties extends Properties { public String getStringOrNull(String property) { String prop = super.getProperty(property); if (prop != null) { prop = prop.trim(); if (prop.isEmpty()) prop = null; } return prop; } MigrationProperties(String filePath); String getStringOrNull(String property); String getRequiredString(String property); int getRequiredInt(String property); long getRequiredLong(String property); boolean getBoolean(String property, boolean defaultValue);  }
@Test public void testGetStringOrNullValid() { assertEquals(VALID_STRING_VALUE, sut.getStringOrNull(VALID_STRING)); }
@Test public void testGetStringOrNullNeedsTrimmed() { assertEquals(VALID_STRING_VALUE, sut.getStringOrNull(NEEDS_TRIMMED_STRING)); }
@Test public void testGetStringOrNullMissing() { assertNull(sut.getStringOrNull(MISSING_PROPERTY)); }
@Test public void testGetStringOrNullEmpty() { assertNull(sut.getStringOrNull(EMPTY_PROPERTY)); }
@Test public void testGetStringOrNullSpaces() { assertNull(sut.getStringOrNull(SPACES_PROPERTY)); }