aboutsummaryrefslogtreecommitdiffstats
path: root/services/services-engine/src/test/java/org
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2021-01-04 13:55:46 +0000
committerliamfallon <liam.fallon@est.tech>2021-01-04 16:26:58 +0000
commitf9455834e7e014fed6e941184ab80eb9fe91d89f (patch)
tree1770a8a258a2516530581d60e50f3841bfd74eaa /services/services-engine/src/test/java/org
parente267120c204303088f3c15e580a5e1a364e014f5 (diff)
Changed identifiers to concept identifiers
The policy models tosca classes ToscaPolicyIdentifier and ToscaPolicyIdentifierOptVersion can be used to identify any TOSCA concept, not just TOSCA policies so they are renamed to ToscaConceptIdentifier and ToscaCinceptIdentifierOptVersion respectively. The class ToscaPolicyTypeIdentifier is redundant and is replaced by ToscaConceptIdentifier. Issue-ID: POLICY-2900 Change-Id: I5df89d023949cdf0f649951dbbd81a0b30f44ef6 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'services/services-engine/src/test/java/org')
-rw-r--r--services/services-engine/src/test/java/org/onap/policy/apex/service/engine/main/ApexMainTest.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/main/ApexMainTest.java b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/main/ApexMainTest.java
index 122e47bb1..68472d4de 100644
--- a/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/main/ApexMainTest.java
+++ b/services/services-engine/src/test/java/org/onap/policy/apex/service/engine/main/ApexMainTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2020 Nordix Foundation.
+ * Modifications Copyright (C) 2020-2021 Nordix Foundation.
* Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -37,7 +37,7 @@ import org.junit.After;
import org.junit.Test;
import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
import org.onap.policy.apex.service.parameters.ApexParameters;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyIdentifier;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
/**
* Test the ApexMain class.
@@ -146,9 +146,9 @@ public class ApexMainTest {
public void testCorrectParametersWithMultiplePolicies() throws ApexException {
OutputStream outContent = new ByteArrayOutputStream();
System.setOut(new PrintStream(outContent));
- Map<ToscaPolicyIdentifier, String[]> argsMap = new HashMap<ToscaPolicyIdentifier, String[]>();
+ Map<ToscaConceptIdentifier, String[]> argsMap = new HashMap<ToscaConceptIdentifier, String[]>();
String[] args = {"-p", "src/test/resources/parameters/correctParams.json"};
- argsMap.put(new ToscaPolicyIdentifier("id1", "v1"), args);
+ argsMap.put(new ToscaConceptIdentifier("id1", "v1"), args);
final ApexMain apexMain = new ApexMain(argsMap);
ApexParameters apexParam = (ApexParameters) apexMain.getApexParametersMap().values().toArray()[0];
assertEquals("MyApexEngine", apexParam.getEngineServiceParameters().getName());
@@ -161,10 +161,10 @@ public class ApexMainTest {
public void testInCorrectParametersWithMultiplePolicies() throws ApexException {
OutputStream outContent = new ByteArrayOutputStream();
System.setOut(new PrintStream(outContent));
- Map<ToscaPolicyIdentifier, String[]> argsMap = new HashMap<ToscaPolicyIdentifier, String[]>();
+ Map<ToscaConceptIdentifier, String[]> argsMap = new HashMap<ToscaConceptIdentifier, String[]>();
String[] args = {"-p", "src/test/resources/parameters/correctParams.json"};
- argsMap.put(new ToscaPolicyIdentifier("id1", "v1"), args);
- argsMap.put(new ToscaPolicyIdentifier("id2", "v2"), args);
+ argsMap.put(new ToscaConceptIdentifier("id1", "v1"), args);
+ argsMap.put(new ToscaConceptIdentifier("id2", "v2"), args);
final ApexMain apexMain = new ApexMain(argsMap);
ApexParameters apexParam = (ApexParameters) apexMain.getApexParametersMap().values().toArray()[0];
assertEquals("MyApexEngine", apexParam.getEngineServiceParameters().getName());
@@ -179,9 +179,9 @@ public class ApexMainTest {
public void testInvalidArgsWithMultiplePolicies() throws ApexException {
OutputStream outContent = new ByteArrayOutputStream();
System.setOut(new PrintStream(outContent));
- Map<ToscaPolicyIdentifier, String[]> argsMap = new HashMap<ToscaPolicyIdentifier, String[]>();
+ Map<ToscaConceptIdentifier, String[]> argsMap = new HashMap<ToscaConceptIdentifier, String[]>();
String[] args = {"-c", "file1", "-m", "file2"};
- argsMap.put(new ToscaPolicyIdentifier("id1", "v1"), args);
+ argsMap.put(new ToscaConceptIdentifier("id1", "v1"), args);
final ApexMain apexMain = new ApexMain(argsMap);
final String outString = outContent.toString();
apexMain.shutdown();