From 0132d3637a889f84897d6a08688b20ff6f606041 Mon Sep 17 00:00:00 2001 From: Francis Toth Date: Tue, 7 Jul 2020 07:24:48 -0400 Subject: Add test contracts for ValidatorExecutor and TopologyTemplateValidatorExecutor Signed-off-by: Francis Toth Change-Id: I10f0de565588e0bc7cd0f47ba7f714eab3f1f7f7 Issue-ID: SDC-2499 --- .../validator/executor/ServiceValidatorExecutor.java | 3 +-- .../executor/TopologyTemplateValidatorExecutor.java | 17 +++++------------ .../impl/validator/executor/VfValidatorExecutor.java | 3 +-- 3 files changed, 7 insertions(+), 16 deletions(-) (limited to 'asdctool/src/main/java/org/openecomp') diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executor/ServiceValidatorExecutor.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executor/ServiceValidatorExecutor.java index ff27b667d5..27bcd1f60d 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executor/ServiceValidatorExecutor.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executor/ServiceValidatorExecutor.java @@ -39,8 +39,7 @@ public class ServiceValidatorExecutor extends TopologyTemplateValidatorExecutor @Autowired(required = false) public ServiceValidatorExecutor(JanusGraphDao janusGraphDao) { - super(janusGraphDao); - setName("SERVICE_VALIDATOR"); + super(janusGraphDao, "SERVICE_VALIDATOR"); } @Override diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executor/TopologyTemplateValidatorExecutor.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executor/TopologyTemplateValidatorExecutor.java index 9ba2f5ab46..95a9fce9af 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executor/TopologyTemplateValidatorExecutor.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executor/TopologyTemplateValidatorExecutor.java @@ -27,6 +27,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import lombok.Getter; import org.openecomp.sdc.asdctool.impl.validator.report.Report; import org.openecomp.sdc.asdctool.impl.validator.report.ReportFile.TXTFile; import org.openecomp.sdc.asdctool.impl.validator.tasks.TopologyTemplateValidationTask; @@ -39,29 +40,21 @@ import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.common.log.wrappers.Logger; -import org.springframework.beans.factory.annotation.Autowired; public class TopologyTemplateValidatorExecutor { private static final Logger log = Logger.getLogger(VfValidatorExecutor.class); - protected JanusGraphDao janusGraphDao; + private final JanusGraphDao janusGraphDao; - protected String name; + @Getter + private final String name; - @Autowired - public TopologyTemplateValidatorExecutor(JanusGraphDao janusGraphDao) { + public TopologyTemplateValidatorExecutor(JanusGraphDao janusGraphDao, String name) { this.janusGraphDao = janusGraphDao; - } - - public void setName(String name) { this.name = name; } - public String getName() { - return name; - } - protected List getVerticesToValidate(ComponentTypeEnum type) { Map props = new EnumMap<>(GraphPropertyEnum.class); props.put(GraphPropertyEnum.COMPONENT_TYPE, type.name()); diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executor/VfValidatorExecutor.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executor/VfValidatorExecutor.java index 4729e63c16..f8aaf5480d 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executor/VfValidatorExecutor.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executor/VfValidatorExecutor.java @@ -36,9 +36,8 @@ public class VfValidatorExecutor extends TopologyTemplateValidatorExecutor imple @Autowired(required = false) public VfValidatorExecutor(List tasks, JanusGraphDao janusGraphDao) { - super(janusGraphDao); + super(janusGraphDao, "BASIC_VF_VALIDATOR"); this.tasks = tasks; - setName("BASIC_VF_VALIDATOR"); } @Override -- cgit 1.2.3-korg