mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-24 01:51:49 +01:00
fixed tests based on changes to APIs and available settings
Former-commit-id: 7de614dd6d13861316e7dd95295f11d2854529f5
This commit is contained in:
@@ -57,8 +57,8 @@ public class SettingsTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testGetString() {
|
public void testGetString() {
|
||||||
String key = Settings.KEYS.CVE_DATA_DIRECTORY;
|
String key = Settings.KEYS.CVE_MODIFIED_VALID_FOR_DAYS;
|
||||||
String expResult = "cve";
|
String expResult = "7";
|
||||||
String result = Settings.getString(key);
|
String result = Settings.getString(key);
|
||||||
Assert.assertTrue(result.endsWith(expResult));
|
Assert.assertTrue(result.endsWith(expResult));
|
||||||
}
|
}
|
||||||
@@ -68,14 +68,10 @@ public class SettingsTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testGetDataFile() throws IOException {
|
public void testGetDataFile() throws IOException {
|
||||||
String key = Settings.KEYS.CVE_DATA_DIRECTORY;
|
String key = Settings.KEYS.DATA_DIRECTORY;
|
||||||
String expResult = "data" + File.separator + "cve";
|
String expResult = "data";
|
||||||
File result = Settings.getDataFile(key);
|
File result = Settings.getDataFile(key);
|
||||||
Assert.assertTrue(result.getAbsolutePath().endsWith(expResult));
|
Assert.assertTrue(result.getAbsolutePath().endsWith(expResult));
|
||||||
|
|
||||||
result = Settings.getDataFile(Settings.KEYS.DATA_DIRECTORY);
|
|
||||||
String path = result.getPath();
|
|
||||||
Assert.assertTrue(path.endsWith("data") || path.endsWith("data" + File.separator));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user