mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-14 15:53:36 +01:00
simplified exception testing
Former-commit-id: f43f211c4cc3133e5dfc466a4badfb3606a3be0c
This commit is contained in:
@@ -18,9 +18,7 @@
|
||||
package org.owasp.dependencycheck.analyzer;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.owasp.dependencycheck.BaseTest;
|
||||
import org.owasp.dependencycheck.Engine;
|
||||
import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
|
||||
@@ -44,9 +42,6 @@ import static org.junit.Assert.assertNull;
|
||||
*/
|
||||
public class AbstractSuppressionAnalyzerTest extends BaseTest {
|
||||
|
||||
@Rule
|
||||
public ExpectedException exception = ExpectedException.none();
|
||||
|
||||
private AbstractSuppressionAnalyzer instance;
|
||||
|
||||
@Before
|
||||
@@ -87,10 +82,9 @@ public class AbstractSuppressionAnalyzerTest extends BaseTest {
|
||||
assertEquals(expCount, result.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(expected = SuppressionParseException.class)
|
||||
public void testFailureToLocateSuppressionFileInClasspath() throws Exception {
|
||||
Settings.setString(Settings.KEYS.SUPPRESSION_FILE, "doesnotexist.xml");
|
||||
exception.expect(SuppressionParseException.class);
|
||||
instance.initialize();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user