fix codacy issues

This commit is contained in:
Jeremy Long
2017-04-01 10:02:24 -04:00
parent 18564e8e86
commit 35d0f21c47
2 changed files with 2 additions and 9 deletions

View File

@@ -30,8 +30,6 @@ import org.owasp.dependencycheck.BaseDBTestCase;
import org.owasp.dependencycheck.utils.Settings; import org.owasp.dependencycheck.utils.Settings;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import org.owasp.dependencycheck.data.nvdcve.CveDB;
import org.owasp.dependencycheck.data.nvdcve.DatabaseException;
/** /**
* *
@@ -66,13 +64,10 @@ public class DependencyCheckTaskTest {
@Test @Test
public void testAddFileSet() throws Exception { public void testAddFileSet() throws Exception {
File report = new File("target/dependency-check-report.html"); File report = new File("target/dependency-check-report.html");
if (report.exists()) { if (report.exists() && !report.delete()) {
if (!report.delete()) { throw new Exception("Unable to delete 'target/DependencyCheck-Report.html' prior to test.");
throw new Exception("Unable to delete 'target/DependencyCheck-Report.html' prior to test.");
}
} }
buildFileRule.executeTarget("test.fileset"); buildFileRule.executeTarget("test.fileset");
assertTrue("DependencyCheck report was not generated", report.exists()); assertTrue("DependencyCheck report was not generated", report.exists());
} }

View File

@@ -25,9 +25,7 @@ import java.io.FileOutputStream;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream; import java.util.zip.ZipInputStream;
import org.apache.commons.compress.utils.IOUtils; import org.apache.commons.compress.utils.IOUtils;
import org.junit.AfterClass;
import org.junit.Before; import org.junit.Before;
import org.owasp.dependencycheck.data.nvdcve.CveDB;
import org.owasp.dependencycheck.utils.Settings; import org.owasp.dependencycheck.utils.Settings;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;