mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-04-30 04:04:30 +02:00
codacy recommended updates
This commit is contained in:
@@ -41,7 +41,7 @@ public class ArchiveAnalyzerIntegrationTest extends BaseDBTestCase {
|
||||
@Test
|
||||
public void testSupportsExtensions() {
|
||||
ArchiveAnalyzer instance = new ArchiveAnalyzer();
|
||||
Set<String> expResult = new HashSet<String>();
|
||||
Set<String> expResult = new HashSet<>();
|
||||
expResult.add("zip");
|
||||
expResult.add("war");
|
||||
expResult.add("ear");
|
||||
@@ -114,6 +114,8 @@ public class ArchiveAnalyzerIntegrationTest extends BaseDBTestCase {
|
||||
|
||||
/**
|
||||
* Test of analyze method, of class ArchiveAnalyzer.
|
||||
*
|
||||
* @throws java.lang.Exception when an error occurs
|
||||
*/
|
||||
@Test
|
||||
public void testAnalyze() throws Exception {
|
||||
@@ -171,7 +173,7 @@ public class ArchiveAnalyzerIntegrationTest extends BaseDBTestCase {
|
||||
instance.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test of analyze method, of class ArchiveAnalyzer.
|
||||
*/
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
package org.owasp.dependencycheck.data.nvdcve;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import org.owasp.dependencycheck.BaseDBTestCase;
|
||||
import org.owasp.dependencycheck.dependency.Vulnerability;
|
||||
import org.owasp.dependencycheck.dependency.VulnerableSoftware;
|
||||
@@ -31,6 +32,7 @@ import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -42,12 +44,14 @@ public class CveDBIntegrationTest extends BaseDBTestCase {
|
||||
* Pretty useless tests of open, commit, and close methods, of class CveDB.
|
||||
*/
|
||||
@Test
|
||||
public void testOpen() throws Exception {
|
||||
public void testOpen() {
|
||||
CveDB instance = null;
|
||||
try {
|
||||
instance = new CveDB();
|
||||
instance.open();
|
||||
instance.commit();
|
||||
} catch (DatabaseException | SQLException ex) {
|
||||
fail(ex.getMessage());
|
||||
} finally {
|
||||
if (instance != null) {
|
||||
instance.close();
|
||||
|
||||
@@ -131,7 +131,7 @@ public class DriverLoaderTest extends BaseTest {
|
||||
File driver = new File(testClassPath, "../../src/test/resources/mysql-connector-java-5.1.27-bin.jar");
|
||||
assertTrue("MySQL Driver JAR file not found in src/test/resources?", driver.isFile());
|
||||
|
||||
Driver d = DriverLoader.load(className, driver.getAbsolutePath());
|
||||
DriverLoader.load(className, driver.getAbsolutePath());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -36,9 +36,6 @@ import org.owasp.dependencycheck.utils.Settings;
|
||||
*/
|
||||
public class DownloadTaskTest extends BaseTest {
|
||||
|
||||
public DownloadTaskTest() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of call method, of class DownloadTask.
|
||||
*/
|
||||
|
||||
@@ -218,7 +218,7 @@ public class DependencyTest extends BaseTest {
|
||||
instance.getProductEvidence().addEvidence("used", "used", "used", Confidence.HIGH);
|
||||
instance.getProductEvidence().addEvidence("not", "not", "not", Confidence.MEDIUM);
|
||||
for (Evidence e : instance.getProductEvidence().iterator(Confidence.HIGH)) {
|
||||
String use = e.getValue();
|
||||
e.getValue();
|
||||
}
|
||||
|
||||
EvidenceCollection result = instance.getEvidenceUsed();
|
||||
|
||||
@@ -71,9 +71,10 @@ public class ModelTest extends BaseTest {
|
||||
*/
|
||||
@Test
|
||||
public void testSetOrganization() {
|
||||
String organization = "";
|
||||
String organization = "apache";
|
||||
Model instance = new Model();
|
||||
instance.setOrganization(organization);
|
||||
assertEquals("apache", instance.getOrganization());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -188,9 +189,10 @@ public class ModelTest extends BaseTest {
|
||||
*/
|
||||
@Test
|
||||
public void testSetParentGroupId() {
|
||||
String parentGroupId = "";
|
||||
String parentGroupId = "org.owasp";
|
||||
Model instance = new Model();
|
||||
instance.setParentGroupId(parentGroupId);
|
||||
assertEquals("org.owasp", instance.getParentGroupId());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user