summaryrefslogtreecommitdiffstats
path: root/plugins/reception-plugins/src/test
diff options
context:
space:
mode:
authorSirisha_Manchikanti <sirisha.manchikanti@est.tech>2022-02-28 17:10:36 +0000
committerSirisha_Manchikanti <sirisha.manchikanti@est.tech>2022-03-02 12:12:49 +0000
commit7ec767641505f52cd8ecf8b9a76fa35afe32635e (patch)
tree90dde20bbe7d13b2ee253a7b21ea1cb18f94194e /plugins/reception-plugins/src/test
parentee04ffd34d67563f1b33a4fbb1eb17e948725d0f (diff)
Rename ControlLoop to AutomationCompsition
Issue-ID: POLICY-3938 Signed-off-by: Sirisha_Manchikanti <sirisha.manchikanti@est.tech> Change-Id: I63188fa9bc5d634d3aeb7e2d7051c4d67b5a202c
Diffstat (limited to 'plugins/reception-plugins/src/test')
-rw-r--r--plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/AutomationCompositionDecoderFileInCsarParameterGroupTest.java (renamed from plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/ControlLoopDecoderFileInCsarParameterGroupTest.java)25
-rw-r--r--plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/AutomationCompositionDecoderFileInCsarTest.java (renamed from plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/ControlLoopDecoderFileInCsarTest.java)35
-rw-r--r--plugins/reception-plugins/src/test/resources/parameters/FileInCsarAutomationCompositionDecoderParameters.json3
-rw-r--r--plugins/reception-plugins/src/test/resources/parameters/FileInCsarAutomationCompositionDecoderParametersInvalid.json3
-rw-r--r--plugins/reception-plugins/src/test/resources/parameters/FileInCsarControlLoopDecoderParameters.json3
-rw-r--r--plugins/reception-plugins/src/test/resources/parameters/FileInCsarControlLoopDecoderParametersInvalid.json3
-rw-r--r--plugins/reception-plugins/src/test/resources/service-Sampleservice-acm.csar (renamed from plugins/reception-plugins/src/test/resources/service-Sampleservice-controlloop.csar)bin79322 -> 79303 bytes
7 files changed, 37 insertions, 35 deletions
diff --git a/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/ControlLoopDecoderFileInCsarParameterGroupTest.java b/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/AutomationCompositionDecoderFileInCsarParameterGroupTest.java
index 16f80096..ea844e4e 100644
--- a/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/ControlLoopDecoderFileInCsarParameterGroupTest.java
+++ b/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/AutomationCompositionDecoderFileInCsarParameterGroupTest.java
@@ -28,39 +28,40 @@ import org.onap.policy.common.parameters.ValidationStatus;
import org.onap.policy.distribution.reception.handling.sdc.CommonTestData;
/**
- * Class to perform unit test of {@link ControlLoopDecoderFileInCsarParameterGroup}.
+ * Class to perform unit test of {@link AutomationCompositionDecoderFileInCsarParameterGroup}.
*
* @author Sirisha Manchikanti (sirisha.manchikanti@est.tech)
*/
-public class ControlLoopDecoderFileInCsarParameterGroupTest {
+public class AutomationCompositionDecoderFileInCsarParameterGroupTest {
@Test
public void testValidParameters() {
- final ControlLoopDecoderFileInCsarParameterGroup configurationParameters = CommonTestData
- .getPolicyDecoderParameters("src/test/resources/parameters/FileInCsarControlLoopDecoderParameters.json",
- ControlLoopDecoderFileInCsarParameterGroup.class);
+ final AutomationCompositionDecoderFileInCsarParameterGroup configurationParameters = CommonTestData
+ .getPolicyDecoderParameters(
+ "src/test/resources/parameters/FileInCsarAutomationCompositionDecoderParameters.json",
+ AutomationCompositionDecoderFileInCsarParameterGroup.class);
- assertEquals(ControlLoopDecoderFileInCsarParameterGroup.class.getSimpleName(),
+ assertEquals(AutomationCompositionDecoderFileInCsarParameterGroup.class.getSimpleName(),
configurationParameters.getName());
- assertEquals("controlloop", configurationParameters.getControlLoopType());
+ assertEquals("acm", configurationParameters.getAutomationCompositionType());
assertEquals(ValidationStatus.CLEAN, configurationParameters.validate().getStatus());
}
@Test
public void testInvalidParameters() {
- final ControlLoopDecoderFileInCsarParameterGroup configurationParameters =
+ final AutomationCompositionDecoderFileInCsarParameterGroup configurationParameters =
CommonTestData.getPolicyDecoderParameters(
- "src/test/resources/parameters/FileInCsarControlLoopDecoderParametersInvalid.json",
- ControlLoopDecoderFileInCsarParameterGroup.class);
+ "src/test/resources/parameters/FileInCsarAutomationCompositionDecoderParametersInvalid.json",
+ AutomationCompositionDecoderFileInCsarParameterGroup.class);
assertEquals(ValidationStatus.INVALID, configurationParameters.validate().getStatus());
}
@Test
public void testEmptyParameters() {
- final ControlLoopDecoderFileInCsarParameterGroup configurationParameters =
+ final AutomationCompositionDecoderFileInCsarParameterGroup configurationParameters =
CommonTestData.getPolicyDecoderParameters("src/test/resources/parameters/EmptyParameters.json",
- ControlLoopDecoderFileInCsarParameterGroup.class);
+ AutomationCompositionDecoderFileInCsarParameterGroup.class);
assertEquals(ValidationStatus.INVALID, configurationParameters.validate().getStatus());
}
diff --git a/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/ControlLoopDecoderFileInCsarTest.java b/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/AutomationCompositionDecoderFileInCsarTest.java
index e452a7ce..80c520a4 100644
--- a/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/ControlLoopDecoderFileInCsarTest.java
+++ b/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/AutomationCompositionDecoderFileInCsarTest.java
@@ -39,22 +39,23 @@ import org.onap.policy.distribution.reception.handling.sdc.CommonTestData;
import org.onap.policy.models.tosca.authorative.concepts.ToscaEntity;
/**
- * Class to perform unit test of {@link ControlLoopDecoderFileInCsar}.
+ * Class to perform unit test of {@link AutomationCompositionDecoderFileInCsar}.
*
* @author Sirisha Manchikanti (sirisha.manchikanti@est.tech)
*/
@RunWith(MockitoJUnitRunner.class)
-public class ControlLoopDecoderFileInCsarTest {
+public class AutomationCompositionDecoderFileInCsarTest {
/**
* Set up.
*/
@BeforeClass
public static void setUp() {
- final ControlLoopDecoderFileInCsarParameterGroup configurationParameters = CommonTestData
- .getPolicyDecoderParameters("src/test/resources/parameters/FileInCsarControlLoopDecoderParameters.json",
- ControlLoopDecoderFileInCsarParameterGroup.class);
- configurationParameters.setName(ControlLoopDecoderFileInCsarParameterGroup.class.getSimpleName());
+ final AutomationCompositionDecoderFileInCsarParameterGroup configurationParameters = CommonTestData
+ .getPolicyDecoderParameters(
+ "src/test/resources/parameters/FileInCsarAutomationCompositionDecoderParameters.json",
+ AutomationCompositionDecoderFileInCsarParameterGroup.class);
+ configurationParameters.setName(AutomationCompositionDecoderFileInCsarParameterGroup.class.getSimpleName());
ParameterService.register(configurationParameters);
}
@@ -63,34 +64,34 @@ public class ControlLoopDecoderFileInCsarTest {
*/
@AfterClass
public static void tearDown() {
- ParameterService.deregister(ControlLoopDecoderFileInCsarParameterGroup.class.getSimpleName());
+ ParameterService.deregister(AutomationCompositionDecoderFileInCsarParameterGroup.class.getSimpleName());
}
@Test
- public void testDecodeControlLoop() throws PolicyDecodingException {
+ public void testDecodeAutomationComposition() throws PolicyDecodingException {
- final ControlLoopDecoderFileInCsar decoder = new ControlLoopDecoderFileInCsar();
- decoder.configure(ControlLoopDecoderFileInCsarParameterGroup.class.getSimpleName());
+ final AutomationCompositionDecoderFileInCsar decoder = new AutomationCompositionDecoderFileInCsar();
+ decoder.configure(AutomationCompositionDecoderFileInCsarParameterGroup.class.getSimpleName());
- final File file = new File("src/test/resources/service-Sampleservice-controlloop.csar");
+ final File file = new File("src/test/resources/service-Sampleservice-acm.csar");
final Csar csar = new Csar(file.getAbsolutePath());
assertTrue(decoder.canHandle(csar));
- final Collection<ToscaEntity> controlLoopHolders = decoder.decode(csar);
- assertEquals(1, controlLoopHolders.size());
+ final Collection<ToscaEntity> automationCompositionHolders = decoder.decode(csar);
+ assertEquals(1, automationCompositionHolders.size());
}
@Test
- public void testDecodeControlLoopZipError() {
+ public void testDecodeAutomationCompositionZipError() {
- final ControlLoopDecoderFileInCsar decoder = new ControlLoopDecoderFileInCsar();
- decoder.configure(ControlLoopDecoderFileInCsarParameterGroup.class.getSimpleName());
+ final AutomationCompositionDecoderFileInCsar decoder = new AutomationCompositionDecoderFileInCsar();
+ decoder.configure(AutomationCompositionDecoderFileInCsarParameterGroup.class.getSimpleName());
final File file = new File("unknown.csar");
final Csar csar = new Csar(file.getAbsolutePath());
assertTrue(decoder.canHandle(csar));
assertThatThrownBy(() -> decoder.decode(csar)).isInstanceOf(PolicyDecodingException.class)
- .hasMessageContaining("Failed decoding the controlloop");
+ .hasMessageContaining("Failed decoding the acm");
}
}
diff --git a/plugins/reception-plugins/src/test/resources/parameters/FileInCsarAutomationCompositionDecoderParameters.json b/plugins/reception-plugins/src/test/resources/parameters/FileInCsarAutomationCompositionDecoderParameters.json
new file mode 100644
index 00000000..672a6677
--- /dev/null
+++ b/plugins/reception-plugins/src/test/resources/parameters/FileInCsarAutomationCompositionDecoderParameters.json
@@ -0,0 +1,3 @@
+{
+ "automationCompositionType": "acm"
+}
diff --git a/plugins/reception-plugins/src/test/resources/parameters/FileInCsarAutomationCompositionDecoderParametersInvalid.json b/plugins/reception-plugins/src/test/resources/parameters/FileInCsarAutomationCompositionDecoderParametersInvalid.json
new file mode 100644
index 00000000..ef58553a
--- /dev/null
+++ b/plugins/reception-plugins/src/test/resources/parameters/FileInCsarAutomationCompositionDecoderParametersInvalid.json
@@ -0,0 +1,3 @@
+{
+ "acm": ""
+}
diff --git a/plugins/reception-plugins/src/test/resources/parameters/FileInCsarControlLoopDecoderParameters.json b/plugins/reception-plugins/src/test/resources/parameters/FileInCsarControlLoopDecoderParameters.json
deleted file mode 100644
index ca112388..00000000
--- a/plugins/reception-plugins/src/test/resources/parameters/FileInCsarControlLoopDecoderParameters.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "controlLoopType": "controlloop"
-}
diff --git a/plugins/reception-plugins/src/test/resources/parameters/FileInCsarControlLoopDecoderParametersInvalid.json b/plugins/reception-plugins/src/test/resources/parameters/FileInCsarControlLoopDecoderParametersInvalid.json
deleted file mode 100644
index 9d33896e..00000000
--- a/plugins/reception-plugins/src/test/resources/parameters/FileInCsarControlLoopDecoderParametersInvalid.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "controlLoop": ""
-}
diff --git a/plugins/reception-plugins/src/test/resources/service-Sampleservice-controlloop.csar b/plugins/reception-plugins/src/test/resources/service-Sampleservice-acm.csar
index 03e29366..226ab158 100644
--- a/plugins/reception-plugins/src/test/resources/service-Sampleservice-controlloop.csar
+++ b/plugins/reception-plugins/src/test/resources/service-Sampleservice-acm.csar
Binary files differ