bc6a5ab890750434b13b7e41f1da43b2931c6af6
[so.git] / mso-api-handlers / mso-api-handler-infra / src / test / java / org / onap / so / apihandlerinfra / tasksbeans / TaskVariableValueTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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
21 package org.onap.so.apihandlerinfra.tasksbeans;
22
23 import org.junit.After;
24 import org.junit.Before;
25 import org.junit.Test;
26 import static org.junit.Assert.*;
27 import static org.mockito.Mockito.mock;
28 import static org.mockito.Mockito.verify;
29 import static org.mockito.Mockito.when;
30
31 public class TaskVariableValueTest {
32         TaskVariableValue _taskVariableValue;
33         protected String _name;
34         protected String _value;
35         protected String _operator;
36
37         public TaskVariableValueTest() {
38         }
39
40         @Before
41         public void setUp() {
42                 _taskVariableValue = mock(TaskVariableValue.class);
43                 _name = "name";
44                 _value = "value";
45                 _operator = "operator";
46                 when(_taskVariableValue.getName()).thenReturn(_name);
47                 when(_taskVariableValue.getValue()).thenReturn(_value);
48                 when(_taskVariableValue.getOperator()).thenReturn(_operator);
49         }
50
51         @After
52         public void tearDown() {
53                 _taskVariableValue = null;
54         }
55
56         /**
57          * Test of getName method
58          */
59         @Test
60         public void testGetName() {
61                 _taskVariableValue.setName(_name);
62                 assertEquals(_taskVariableValue.getName(),_name);
63
64         }
65
66         /**
67          * Test setName
68          */
69         @Test
70         public void testSetName() {
71                 _taskVariableValue.setName(_name);
72                 verify(_taskVariableValue).setName(_name);
73         }
74         
75         /**
76          * Test of getName method
77          */
78         @Test
79         public void testGetValue() {
80                 _taskVariableValue.setValue(_value);
81                 assertEquals(_taskVariableValue.getValue(),_value);
82
83         }
84
85         /**
86          * Test setName
87          */
88         @Test
89         public void testSetValue() {
90                 _taskVariableValue.setValue(_value);
91                 verify(_taskVariableValue).setValue(_value);
92         }
93         
94         /**
95          * Test of getName method
96          */
97         @Test
98         public void testGetOperator() {
99                 _taskVariableValue.setOperator(_operator);
100                 assertEquals(_taskVariableValue.getOperator(),_operator);
101
102         }
103
104         /**
105          * Test setName
106          */
107         @Test
108         public void testSetRequestDetails() {
109                 _taskVariableValue.setOperator(_operator);
110                 verify(_taskVariableValue).setOperator(_operator);
111         }
112
113 }