test: Fixing extractable test to support fallback.
@@ -4,10 +4,12 @@ import java.io.File;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
+import java.util.Optional;
import java.util.Set;
import java.util.function.Predicate;
import org.junit.jupiter.api.Test;
+import org.mockito.Mock;
import org.mockito.Mockito;
import com.synopsys.integration.detectable.Detectable;
@@ -19,6 +21,7 @@ import com.synopsys.integration.detector.base.DetectorEvaluation;
import com.synopsys.integration.detector.base.DetectorEvaluationTree;
import com.synopsys.integration.detector.result.DetectorResult;
import com.synopsys.integration.detector.rule.DetectorRule;
+import com.synopsys.integration.detector.rule.DetectorRuleSet;
public class DetectorEvaluatorTest {
@@ -79,12 +82,16 @@ public class DetectorEvaluatorTest {
List<DetectorEvaluation> detectorEvaluations = Arrays.asList(detectorEvaluation);
Mockito.when(detectorEvaluationTree.getOrderedEvaluations()).thenReturn(detectorEvaluations);
+ final DetectorRuleSet detectorRuleSet = Mockito.mock(DetectorRuleSet.class);
+ Mockito.when(detectorEvaluationTree.getDetectorRuleSet()).thenReturn(detectorRuleSet);
+
final DetectorEvaluatorListener detectorEvaluatorListener = Mockito.mock(DetectorEvaluatorListener.class);
evaluator.setDetectorEvaluatorListener(detectorEvaluatorListener);
DetectorRule detectorRule = Mockito.mock(DetectorRule.class);
Mockito.when(detectorRule.getDescriptiveName()).thenReturn("test rule");
Mockito.when(detectorEvaluation.getDetectorRule()).thenReturn(detectorRule);
+ Mockito.when(detectorRuleSet.getFallbackFrom(Mockito.any())).thenReturn(Optional.empty());
Mockito.when(detectorEvaluationTree.getDepthFromRoot()).thenReturn(0);
Mockito.when(evaluationOptions.isForceNested()).thenReturn(true);
