From 6ca9bedf6206a98991acb742206ce0b8113684fa Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Tue, 19 Feb 2019 17:55:41 -0500 Subject: flowvaldiator will allow more flexible filtering fixed unit tests that reference forItems() forItems is now shouldRunFor allowing more flexibility Change-Id: I497f3a2899ae4df555e781c7c85a238e657fcba8 Issue-ID: SO-1533 Signed-off-by: Benjamin, Max (mb388a) --- .../main/java/org/onap/so/bpmn/common/validation/FlowValidator.java | 4 ++-- .../java/org/onap/so/bpmn/common/validation/FlowValidatorRunner.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'bpmn/MSOCommonBPMN/src/main/java/org') diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/validation/FlowValidator.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/validation/FlowValidator.java index a2e6804a7f..c457a349c2 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/validation/FlowValidator.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/validation/FlowValidator.java @@ -28,10 +28,10 @@ import org.onap.so.bpmn.common.BuildingBlockExecution; public interface FlowValidator { /** - * Names of items to be validated + * Should this validator run for given bb * @return */ - public Set forItems(); + public boolean shouldRunFor(String bbName); /** * Determines whether or not the workflow should be executed diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/validation/FlowValidatorRunner.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/validation/FlowValidatorRunner.java index 9e6ea53a47..636c8e32cf 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/validation/FlowValidatorRunner.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/validation/FlowValidatorRunner.java @@ -122,7 +122,7 @@ public abstract class FlowValidatorRunner filterValidators(List validators, String bbName) { return validators.stream() .filter(item -> { - return item.forItems().contains(bbName); + return item.shouldRunFor(bbName); }) .sorted(Comparator.comparing(item -> { Priority p = Optional.ofNullable(item.getClass().getAnnotation(Priority.class)).orElse(new Priority() { -- cgit 1.2.3-korg