DCAE-D be initial commit
[sdc/dcae-d/dt-be-main.git] / dcaedt_catalog / asdc / src / test / org / onap / sdc / dcae / utils / NormalizersTest.java
1 package org.onap.sdc.dcae.utils;
2
3 import static org.assertj.core.api.Assertions.*;
4
5 import org.assertj.core.api.Assertions;
6 import org.junit.Test;
7 import org.onap.sdc.dcae.utils.Normalizers;
8
9
10 public class NormalizersTest {
11
12     @Test
13     public void normalizeVFCMTName_withDot_withoutDot(){
14         Assertions.assertThat(Normalizers.normalizeComponentName("my.dot")).isEqualTo("MyDot");
15     }
16
17     @Test
18     public void normalizeVFCMTName_withUnderscore_withoutUnderscore(){
19         Assertions.assertThat(Normalizers.normalizeComponentName("My_Monitoring_Template_example")).isEqualTo("MyMonitoringTemplateExample");
20     }
21
22     @Test
23     public void normalizeVFCMTName_withWhiteSpace_withoutWhiteSpace(){
24         Assertions.assertThat(Normalizers.normalizeComponentName("       my        dot     ")).isEqualTo("MyDot");
25     }
26
27     @Test
28     public void normalizeVFCMTName_withDash_withoutDash(){
29         Assertions.assertThat(Normalizers.normalizeComponentName("My-Monitoring-Template-example")).isEqualTo("MyMonitoringTemplateExample");
30     }
31
32     @Test
33     public void normalizeVFCMTName_notCapitalized_capitalized(){
34         Assertions.assertThat(Normalizers.normalizeComponentName("my monitoring template eXAMPLE")).isEqualTo("MyMonitoringTemplateExample");
35     }
36
37     @Test
38     public void normalizeArtifactLabel_withDash_withoutDash(){
39         Assertions.assertThat(Normalizers.normalizeArtifactLabel("blueprint-other")).isEqualTo("blueprintother");
40     }
41
42     @Test
43     public void normalizeArtifactLabel_withWhiteSpace_withoutWhiteSpace(){
44         Assertions.assertThat(Normalizers.normalizeArtifactLabel("       blueprint        other")).isEqualTo("blueprintother");
45     }
46
47     @Test
48     public void normalizeArtifactLabel_withPlus_withoutPlus(){
49         Assertions.assertThat(Normalizers.normalizeArtifactLabel("+blueprint+++other+")).isEqualTo("blueprintother");
50     }
51 }