ClientSettingsWrapper { public final boolean getOverheatingAlarm(TankSelector tank, boolean defaultValue) { String tankString = tank.name(); String entry = properties.getProperty("overheatingAlarm_" + tankString); if (entry == null || (!entry.equals("true") && !entry.equals("false"))) { return defaultValue; } return Boolean.parseBoolean(entry); } ClientSettingsWrapper(File settingsFile); final void setServerHostname(TankSelector tank, String hostname); final void setServerPort(TankSelector tank, int portServer); final void setFetchInterval(int intervalMs); final void setOverflowAlarm(TankSelector tank, boolean enabled); final void setUnderflowAlarm(TankSelector tank, boolean enabled); final void setOverheatingAlarm(TankSelector tank, boolean enabled); final void setUndercoolingAlarm(TankSelector tank, boolean enabled); final void setTempDiagram(TankSelector tank, boolean enabled); final void setFillLevelDiagram(TankSelector tank, boolean enabled); final int getFetchInterval(int defaultValue); final boolean getOverheatingAlarm(TankSelector tank, boolean defaultValue); final boolean getUndercoolingAlarm(TankSelector tank, boolean defaultValue); final boolean getOverflowAlarm(TankSelector tank, boolean defaultValue); final boolean getUnderflowAlarm(TankSelector tank, boolean defaultValue); final boolean getTempDiagram(TankSelector tank, boolean defaultValue); final boolean getFillLevelDiagram(TankSelector tank, boolean defaultValue); final String getHostname(TankSelector tank, String defaultValue); final int getPort(TankSelector tank, int defaultValue); final void saveSettings();  }
@Test public void testGetOverheatingAlarm() { boolean result = wrapper.getOverheatingAlarm(testTank, false); assertFalse(result); }
@Test public void testNullOverheatingAlarm() { boolean value = wrapperNullEntry.getOverheatingAlarm(testTank, false); assertFalse(value); }
@Test public void testNullOverheatingAlarmAlternativeDefault() { boolean value = wrapperNullEntry.getOverheatingAlarm(testTank, true); assertTrue(value); }
@Test public void testInvalidOverheatingAlarm() { boolean value = wrapperInvalidEntry.getOverheatingAlarm(testTank, false); assertFalse(value); }
@Test public void testInvalidOverheatingAlarmAlternativeDefault() { boolean value = wrapperInvalidEntry.getOverheatingAlarm(testTank, true); assertTrue(value); }