Update the license for 2017-2018 license
[aai/traversal.git] / aai-traversal / src / test / java / org / onap / aai / transforms / LowerHyphenToLowerCamelConverterTest.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *    http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20 package org.onap.aai.transforms;
21
22 import org.junit.Test;
23 import org.junit.runner.RunWith;
24 import org.junit.runners.Parameterized;
25 import org.junit.runners.Parameterized.Parameters;
26
27 import java.util.Arrays;
28 import java.util.Collection;
29
30 import static org.junit.Assert.*;
31
32 @RunWith(Parameterized.class)
33 public class LowerHyphenToLowerCamelConverterTest {
34
35     private Converter converter = new LowerHyphenToLowerCamelConverter();
36
37     private String input;
38     private String expected;
39
40     public LowerHyphenToLowerCamelConverterTest(String input, String expected){
41         this.input  = input;
42         this.expected = expected;
43     }
44
45     /**
46      * Data Provider for the Lower Hyphen to Camel Converter Tests
47      * Make sure the capitalization is not lost during the conversion
48      * @return
49      */
50     @Parameters
51     public static Collection<Object[]> data(){
52
53         return Arrays.asList(new Object[][]{
54             {null, null},
55             {"test-name", "testName"},
56             {"test---name", "testName"},            // Case multiple
57             {"testName", "testName"},               // Case where upper case word shouldn't be lowercased
58             {"test-name-cool", "testNameCool"},
59             {"test-name-Cool", "testNameCool"},
60             {"test-name-Cool-Name-wow----Rest", "testNameCoolNameWowRest"},
61             {"test-name#fast#", "testName#fast#"},
62             {"test-name---", "testName"},
63             {"----test-name", "TestName"},
64         });
65     }
66
67     @Test
68     public void testIfInputSuccessfullyModified(){
69         String actual = converter.convert(input);
70         assertEquals(expected, actual);
71     }
72 }