diff options
author | Jim Hahn <jrh3@att.com> | 2020-08-26 16:57:52 -0400 |
---|---|---|
committer | Pamela Dragosh <pdragosh@research.att.com> | 2020-08-27 14:29:28 -0400 |
commit | 3052f10337897ea25983f35f4158c5626febbe7d (patch) | |
tree | 19da96c57189c04f1b6dd8cf17702b7ff36f367f /controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/SupportUtil.java | |
parent | 14c9b3e48963d9283d77d140bcbe1ee4d4d24200 (diff) |
Use ToscaPolicy instead of legacy Policy
Removed usage of policy-yaml and old targetType definition.
Switched to using TOSCA operational policy classes and new
definitions for Target type enum.
Issue-ID: POLICY-2428
Change-Id: I25d1c5219764df27bdae7f2cbeb7ada7bcef4e1e
Signed-off-by: Jim Hahn <jrh3@att.com>
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/SupportUtil.java')
-rw-r--r-- | controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/SupportUtil.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/SupportUtil.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/SupportUtil.java index 9534f938a..05eba6450 100644 --- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/SupportUtil.java +++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/SupportUtil.java @@ -26,7 +26,7 @@ import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; import org.apache.commons.io.IOUtils; -import org.onap.policy.controlloop.policy.ControlLoopPolicy; +import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.Constructor; @@ -53,15 +53,15 @@ public final class SupportUtil { * @return a Pair * @throws IOException if the file cannot be read */ - public static Pair<ControlLoopPolicy, String> loadYaml(String testFile) throws IOException { + public static Pair<ToscaPolicy, String> loadYaml(String testFile) throws IOException { try (InputStream is = new FileInputStream(new File(testFile))) { String contents = IOUtils.toString(is, StandardCharsets.UTF_8); // // Read the yaml into our Java Object // - Yaml yaml = new Yaml(new Constructor(ControlLoopPolicy.class)); - Object obj = yaml.load(contents); - return new Pair<>((ControlLoopPolicy) obj, contents); + Yaml yaml = new Yaml(new Constructor(ToscaPolicy.class)); + ToscaPolicy obj = yaml.load(contents); + return new Pair<>(obj, contents); } } |