2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 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=========================================================
21 package org.openecomp.aai.transforms;
23 import org.junit.Test;
24 import org.junit.runner.RunWith;
25 import org.junit.runners.Parameterized;
26 import org.junit.runners.Parameterized.Parameters;
28 import java.util.Arrays;
29 import java.util.Collection;
31 import static org.junit.Assert.*;
33 @RunWith(Parameterized.class)
34 public class LowerHyphenToLowerCamelConverterTest {
36 private Converter converter = new LowerHyphenToLowerCamelConverter();
39 private String expected;
41 public LowerHyphenToLowerCamelConverterTest(String input, String expected){
43 this.expected = expected;
47 * Data Provider for the Lower Hyphen to Camel Converter Tests
48 * Make sure the capitalization is not lost during the conversion
52 public static Collection<Object[]> data(){
54 return Arrays.asList(new Object[][]{
56 {"test-name", "testName"},
57 {"test---name", "testName"}, // Case multiple
58 {"testName", "testName"}, // Case where upper case word shouldn't be lowercased
59 {"test-name-cool", "testNameCool"},
60 {"test-name-Cool", "testNameCool"},
61 {"test-name-Cool-Name-wow----Rest", "testNameCoolNameWowRest"},
62 {"test-name#fast#", "testName#fast#"},
63 {"test-name---", "testName"},
64 {"----test-name", "TestName"},
69 public void testIfInputSuccessfullyModified(){
70 String actual = converter.convert(input);
71 assertEquals(expected, actual);