From f9455834e7e014fed6e941184ab80eb9fe91d89f Mon Sep 17 00:00:00 2001 From: liamfallon Date: Mon, 4 Jan 2021 13:55:46 +0000 Subject: 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 --- .../policy/apex/service/engine/main/ApexMainTest.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'services/services-engine/src/test') 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 argsMap = new HashMap(); + Map argsMap = new HashMap(); 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 argsMap = new HashMap(); + Map argsMap = new HashMap(); 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 argsMap = new HashMap(); + Map argsMap = new HashMap(); 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(); -- cgit 1.2.3-korg