summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/test/java/org
diff options
context:
space:
mode:
authoraribeiro <anderson.ribeiro@est.tech>2020-05-20 10:05:48 +0100
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-06-08 06:56:36 +0000
commit966271e4e2601d58eb06f286a3b2921e803fa9af (patch)
tree01752d24145128fa3687e91e21e58fd6fabe6276 /catalog-be/src/test/java/org
parent116c26e1c243f26258558148e9f69e42b3787367 (diff)
Make Directive values Tosca compliant
Issue-ID: SDC-3079 Signed-off-by: aribeiro <anderson.ribeiro@est.tech> Change-Id: Ie711c61244a4e2d68a96e2814ba2db52e067c6e4
Diffstat (limited to 'catalog-be/src/test/java/org')
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/utils/DirectivesEnumTest.java (renamed from catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/utils/DirectivesUtilsTest.java)31
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/nodeFilter/BaseServiceFilterUtilsTest.java4
2 files changed, 18 insertions, 17 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/utils/DirectivesUtilsTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/utils/DirectivesEnumTest.java
index 9e27134a33..529625b451 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/utils/DirectivesUtilsTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/utils/DirectivesEnumTest.java
@@ -22,39 +22,40 @@
package org.openecomp.sdc.be.components.impl.utils;
-import org.junit.Before;
-import org.junit.Test;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
+import org.junit.Before;
+import org.junit.Test;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-public class DirectivesUtilsTest {
+public class DirectivesEnumTest {
private List<String> directives;
@Before
- public void setup(){
+ public void setup() {
directives = new ArrayList<>();
}
@Test
- public void testGivenValidDirectives_returnsTrue(){
- directives.add(DirectivesUtils.DIRECTIVE.SUBSTITUTABLE.toString());
- directives.add(DirectivesUtils.DIRECTIVE.SELECTABLE.toString());
- assertTrue(DirectivesUtils.isValid(directives));
+ public void testGivenValidDirectives_returnsTrue() {
+ directives.add(DirectivesEnum.SELECT.getValue());
+ directives.add(DirectivesEnum.SELECTABLE.getValue());
+ directives.add(DirectivesEnum.SUBSTITUTE.getValue());
+ directives.add(DirectivesEnum.SUBSTITUTABLE.getValue());
+ assertTrue(DirectivesEnum.isValid(directives));
}
@Test
- public void testGivenEmptyDirectives_returnsTrue(){
- assertTrue(DirectivesUtils.isValid(directives));
+ public void testGivenEmptyDirectives_returnsTrue() {
+ assertTrue(DirectivesEnum.isValid(directives));
}
@Test
- public void testGivenInvalidDirectives_returnsFalse(){
+ public void testGivenInvalidDirectives_returnsFalse() {
directives.add("Invalid");
- assertFalse(DirectivesUtils.isValid(directives));
+ assertFalse(DirectivesEnum.isValid(directives));
}
} \ No newline at end of file
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/nodeFilter/BaseServiceFilterUtilsTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/nodeFilter/BaseServiceFilterUtilsTest.java
index 8ddf06abb8..adf6e4439d 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/nodeFilter/BaseServiceFilterUtilsTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/nodeFilter/BaseServiceFilterUtilsTest.java
@@ -18,7 +18,7 @@ package org.openecomp.sdc.be.nodeFilter;
import org.junit.Assert;
import org.junit.Before;
-import org.openecomp.sdc.be.components.impl.utils.DirectivesUtils;
+import org.openecomp.sdc.be.components.impl.utils.DirectivesEnum;
import org.openecomp.sdc.be.datatypes.elements.CINodeFilterDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.ListDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.RequirementNodeFilterPropertyDataDefinition;
@@ -46,7 +46,7 @@ public class BaseServiceFilterUtilsTest {
componentInstance.setUniqueId(CI_NAME);
componentInstance.setName(CI_NAME);
service.setComponentInstances(Arrays.asList(componentInstance));
- componentInstance.setDirectives(Arrays.asList(DirectivesUtils.SELECTABLE));
+ componentInstance.setDirectives(Arrays.asList(DirectivesEnum.SELECTABLE.getValue()));
CINodeFilterDataDefinition serviceFilter = new CINodeFilterDataDefinition();
componentInstance.setNodeFilter(serviceFilter);
requirementNodeFilterPropertyDataDefinition = new RequirementNodeFilterPropertyDataDefinition();