mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-15 00:03:43 +01:00
simplified exception testing
Former-commit-id: cf543a3ec397e593e7de2249820bd48159132413
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