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