summaryrefslogtreecommitdiffstats
path: root/dcaedt_catalog/asdc/src/test
diff options
context:
space:
mode:
authorStone, Avi (as206k) <as206k@att.com>2018-04-12 15:46:31 +0300
committerStone, Avi (as206k) <as206k@att.com>2018-04-12 15:49:38 +0300
commit5032434b101f25fa44d2e1f8dc8393e30af1ed4f (patch)
tree2dc7d37a8048e025c7412af080640da4c9a22b65 /dcaedt_catalog/asdc/src/test
parent2205633792f95f46a02bbf8f87f0c2637265d924 (diff)
DCAE-D be initial commit
DCAE-D be initial commit Issue-ID: SDC-1218 Change-Id: Id18ba96c499e785aa9ac395fbaf32d57f08c281b Signed-off-by: Stone, Avi (as206k) <as206k@att.com>
Diffstat (limited to 'dcaedt_catalog/asdc/src/test')
-rw-r--r--dcaedt_catalog/asdc/src/test/org/onap/sdc/dcae/utils/NormalizersTest.java51
1 files changed, 51 insertions, 0 deletions
diff --git a/dcaedt_catalog/asdc/src/test/org/onap/sdc/dcae/utils/NormalizersTest.java b/dcaedt_catalog/asdc/src/test/org/onap/sdc/dcae/utils/NormalizersTest.java
new file mode 100644
index 0000000..bf06e22
--- /dev/null
+++ b/dcaedt_catalog/asdc/src/test/org/onap/sdc/dcae/utils/NormalizersTest.java
@@ -0,0 +1,51 @@
+package org.onap.sdc.dcae.utils;
+
+import static org.assertj.core.api.Assertions.*;
+
+import org.assertj.core.api.Assertions;
+import org.junit.Test;
+import org.onap.sdc.dcae.utils.Normalizers;
+
+
+public class NormalizersTest {
+
+ @Test
+ public void normalizeVFCMTName_withDot_withoutDot(){
+ Assertions.assertThat(Normalizers.normalizeComponentName("my.dot")).isEqualTo("MyDot");
+ }
+
+ @Test
+ public void normalizeVFCMTName_withUnderscore_withoutUnderscore(){
+ Assertions.assertThat(Normalizers.normalizeComponentName("My_Monitoring_Template_example")).isEqualTo("MyMonitoringTemplateExample");
+ }
+
+ @Test
+ public void normalizeVFCMTName_withWhiteSpace_withoutWhiteSpace(){
+ Assertions.assertThat(Normalizers.normalizeComponentName(" my dot ")).isEqualTo("MyDot");
+ }
+
+ @Test
+ public void normalizeVFCMTName_withDash_withoutDash(){
+ Assertions.assertThat(Normalizers.normalizeComponentName("My-Monitoring-Template-example")).isEqualTo("MyMonitoringTemplateExample");
+ }
+
+ @Test
+ public void normalizeVFCMTName_notCapitalized_capitalized(){
+ Assertions.assertThat(Normalizers.normalizeComponentName("my monitoring template eXAMPLE")).isEqualTo("MyMonitoringTemplateExample");
+ }
+
+ @Test
+ public void normalizeArtifactLabel_withDash_withoutDash(){
+ Assertions.assertThat(Normalizers.normalizeArtifactLabel("blueprint-other")).isEqualTo("blueprintother");
+ }
+
+ @Test
+ public void normalizeArtifactLabel_withWhiteSpace_withoutWhiteSpace(){
+ Assertions.assertThat(Normalizers.normalizeArtifactLabel(" blueprint other")).isEqualTo("blueprintother");
+ }
+
+ @Test
+ public void normalizeArtifactLabel_withPlus_withoutPlus(){
+ Assertions.assertThat(Normalizers.normalizeArtifactLabel("+blueprint+++other+")).isEqualTo("blueprintother");
+ }
+}