mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-14 07:43:40 +01:00
updated log message to assist in debugging an issue
This commit is contained in:
@@ -743,7 +743,7 @@ public final class Settings {
|
||||
try {
|
||||
value = Integer.parseInt(Settings.getString(key));
|
||||
} catch (NumberFormatException ex) {
|
||||
LOGGER.trace("Could not convert property '{}={}' to an int.", key, Settings.getString(key));
|
||||
LOGGER.debug("Could not convert property '{}={}' to an int; using {} instead.", key, Settings.getString(key), defaultValue);
|
||||
value = defaultValue;
|
||||
}
|
||||
return value;
|
||||
|
||||
@@ -139,6 +139,18 @@ public class SettingsTest extends BaseTest {
|
||||
Assert.assertEquals(expResult, result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of getInt method, of class Settings.
|
||||
*/
|
||||
@Test
|
||||
public void testGetIntDefault() throws InvalidSettingException {
|
||||
String key = "SomeKey";
|
||||
int expResult = 85;
|
||||
Settings.setString(key, "blue");
|
||||
int result = Settings.getInt(key, expResult);
|
||||
Assert.assertEquals(expResult, result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of getLong method, of class Settings.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user