Catalog alignment
[sdc.git] / catalog-be / src / test / java / org / openecomp / sdc / be / components / property / GetInputUtilsTest.java
1 /*
2  * Copyright © 2016-2019 European Support Limited
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.openecomp.sdc.be.components.property;
18
19 import org.junit.Before;
20 import org.junit.Test;
21 import org.openecomp.sdc.be.datatypes.elements.GetInputValueDataDefinition;
22
23 import static org.junit.Assert.assertTrue;
24
25 public class GetInputUtilsTest {
26     private static final String INPUT_ID = "inputUid";
27     private GetInputValueDataDefinition getInput;
28
29     @Before
30     public void init() {
31         getInput = new GetInputValueDataDefinition();
32         getInput.setInputId(INPUT_ID);
33     }
34
35     @Test
36     public void isGetInputValueForInput_equalId() {
37         boolean getInputValueForInput = GetInputUtils.isGetInputValueForInput(getInput, INPUT_ID);
38         assertTrue(getInputValueForInput);
39     }
40
41     @Test
42     public void isGetInputValueForInput_byInputData() {
43         GetInputValueDataDefinition getInputIndex = new GetInputValueDataDefinition();
44         getInputIndex.setInputId(INPUT_ID);
45         getInput.setGetInputIndex(getInputIndex);
46         getInput.setInputId("");
47
48         boolean getInputValueForInput = GetInputUtils.isGetInputValueForInput(getInput, INPUT_ID);
49         assertTrue(getInputValueForInput);
50     }
51 }