diff options
author | Steve Smokowski <ss835w@att.com> | 2019-02-20 13:13:38 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-02-20 13:13:38 +0000 |
commit | 75a0957c5d544bf96bbcfba1594d1e23b417a01e (patch) | |
tree | d180c0efe0163e4bcf73b2996745179661de7c8e | |
parent | 48019661af4ee9e36d0aa9c015b8e2d52e129ed4 (diff) | |
parent | 6ca9bedf6206a98991acb742206ce0b8113684fa (diff) |
Merge "flowvaldiator will allow more flexible filtering"
8 files changed, 15 insertions, 15 deletions
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<String> 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<S extends FlowValidator, E extends Flo protected List<FlowValidator> filterValidators(List<? extends FlowValidator> 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() { diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/MyPreValidatorFour.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/MyPreValidatorFour.java index fbd709b058..af45a129e2 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/MyPreValidatorFour.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/MyPreValidatorFour.java @@ -31,8 +31,8 @@ import org.springframework.stereotype.Component; public class MyPreValidatorFour implements PreBuildingBlockValidator { @Override - public Set<String> forItems() { - return Collections.singleton("test2"); + public boolean shouldRunFor(String bbName) { + return Collections.singleton("test2").contains(bbName); } @Override diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/MyPreValidatorOne.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/MyPreValidatorOne.java index f642f915b7..d1d50e2a89 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/MyPreValidatorOne.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/MyPreValidatorOne.java @@ -31,9 +31,9 @@ import org.springframework.stereotype.Component; public class MyPreValidatorOne implements PreBuildingBlockValidator { @Override - public Set<String> forItems() { + public boolean shouldRunFor(String bbName) { - return Collections.singleton("test"); + return Collections.singleton("test").contains(bbName); } @Override diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/MyPreValidatorThree.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/MyPreValidatorThree.java index 780fb43c2a..363020de71 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/MyPreValidatorThree.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/MyPreValidatorThree.java @@ -31,8 +31,8 @@ import org.springframework.stereotype.Component; public class MyPreValidatorThree implements PreBuildingBlockValidator { @Override - public Set<String> forItems() { - return Collections.singleton("test2"); + public boolean shouldRunFor(String bbName) { + return Collections.singleton("test2").contains(bbName); } @Override diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/MyPreValidatorTwo.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/MyPreValidatorTwo.java index c8ff6ef848..4d78f4e458 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/MyPreValidatorTwo.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/MyPreValidatorTwo.java @@ -34,8 +34,8 @@ import org.springframework.stereotype.Component; public class MyPreValidatorTwo implements PreBuildingBlockValidator { @Override - public Set<String> forItems() { - return Collections.singleton("test"); + public boolean shouldRunFor(String bbName) { + return Collections.singleton("test").contains(bbName); } @Override diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/WorkflowPreValidatorOne.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/WorkflowPreValidatorOne.java index bfe3ec06a3..891496fa2b 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/WorkflowPreValidatorOne.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/WorkflowPreValidatorOne.java @@ -31,9 +31,9 @@ import org.springframework.stereotype.Component; public class WorkflowPreValidatorOne implements PreWorkflowValidator { @Override - public Set<String> forItems() { + public boolean shouldRunFor(String bbName) { - return Collections.singleton("test"); + return Collections.singleton("test").contains(bbName); } @Override diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/WorkflowPreValidatorTwo.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/WorkflowPreValidatorTwo.java index ddf5f22f00..80b55df8f5 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/WorkflowPreValidatorTwo.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/validation/WorkflowPreValidatorTwo.java @@ -34,8 +34,8 @@ import org.springframework.stereotype.Component; public class WorkflowPreValidatorTwo implements PreWorkflowValidator { @Override - public Set<String> forItems() { - return Collections.singleton("test"); + public boolean shouldRunFor(String bbName) { + return Collections.singleton("test").contains(bbName); } @Override |