PropertyUtil { public int readInt(String propName) { return Integer.parseInt(props.getProperty(propName)); } PropertyUtil(Properties props); int readInt(String propName); int readInt(String propName, int defaultValue); double readDouble(String propName); double readDouble(String propName, double defaultValue); boolean readBoolean(String propName); boolean readBoolean(String propName, boolean defaultValue); LocalTime readLocalTime(String propName); LocalTime readLocalTime( String propName, LocalTime defaultValue );  }
@Test public void testReadInt() { testProperties.setProperty("myIntProp", "2"); assertEquals(2, testPropertyUtil.readInt("myIntProp")); }
@Test public void testReadInt_DefaultValueNotNeeded() { testProperties.setProperty("myIntProp", "2"); assertEquals(2, testPropertyUtil.readInt("myIntProp", 3)); }
@Test public void testReadInt_DefaultValueNeeded() { assertEquals(2, testPropertyUtil.readInt("myIntProp", 3)); }