2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
20 package org.onap.aai.transforms;
22 import org.junit.Test;
23 import org.junit.runner.RunWith;
24 import org.junit.runners.Parameterized;
25 import org.junit.runners.Parameterized.Parameters;
27 import java.util.Arrays;
28 import java.util.Collection;
30 import static org.junit.Assert.*;
32 @RunWith(Parameterized.class)
33 public class LowerHyphenToLowerCamelConverterTest {
35 private Converter converter = new LowerHyphenToLowerCamelConverter();
38 private String expected;
40 public LowerHyphenToLowerCamelConverterTest(String input, String expected){
42 this.expected = expected;
46 * Data Provider for the Lower Hyphen to Camel Converter Tests
47 * Make sure the capitalization is not lost during the conversion
51 public static Collection<Object[]> data(){
53 return Arrays.asList(new Object[][]{
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"},
68 public void testIfInputSuccessfullyModified(){
69 String actual = converter.convert(input);
70 assertEquals(expected, actual);