Merge "Reorder modifiers"
[so.git] / mso-api-handlers / mso-api-handler-infra / src / test / java / org / openecomp / mso / apihandlerinfra / tasksbeans / TaskVariableValueTest.java
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * ONAP - SO\r
4  * ================================================================================\r
5  * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.\r
6  * ================================================================================\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  *\r
11  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  *\r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  * ============LICENSE_END=========================================================\r
19  */\r
20 \r
21 package org.openecomp.mso.apihandlerinfra.tasksbeans;\r
22 \r
23 import org.junit.After;\r
24 import org.junit.Before;\r
25 import org.junit.Test;\r
26 import static org.junit.Assert.*;\r
27 import static org.mockito.Mockito.mock;\r
28 import static org.mockito.Mockito.verify;\r
29 import static org.mockito.Mockito.when;\r
30 \r
31 public class TaskVariableValueTest {\r
32         TaskVariableValue _taskVariableValue;\r
33         protected String _name;\r
34         protected String _value;\r
35         protected String _operator;\r
36 \r
37         public TaskVariableValueTest() {\r
38         }\r
39 \r
40         @Before\r
41         public void setUp() {\r
42                 _taskVariableValue = mock(TaskVariableValue.class);\r
43                 _name = "name";\r
44                 _value = "value";\r
45                 _operator = "operator";\r
46                 when(_taskVariableValue.getName()).thenReturn(_name);\r
47                 when(_taskVariableValue.getValue()).thenReturn(_value);\r
48                 when(_taskVariableValue.getOperator()).thenReturn(_operator);\r
49         }\r
50 \r
51         @After\r
52         public void tearDown() {\r
53                 _taskVariableValue = null;\r
54         }\r
55 \r
56         /**\r
57          * Test of getName method\r
58          */\r
59         @Test\r
60         public void testGetName() {\r
61                 _taskVariableValue.setName(_name);\r
62                 assertEquals(_taskVariableValue.getName(),_name);\r
63 \r
64         }\r
65 \r
66         /**\r
67          * Test setName\r
68          */\r
69         @Test\r
70         public void testSetName() {\r
71                 _taskVariableValue.setName(_name);\r
72                 verify(_taskVariableValue).setName(_name);\r
73         }\r
74         \r
75         /**\r
76          * Test of getName method\r
77          */\r
78         @Test\r
79         public void testGetValue() {\r
80                 _taskVariableValue.setValue(_value);\r
81                 assertEquals(_taskVariableValue.getValue(),_value);\r
82 \r
83         }\r
84 \r
85         /**\r
86          * Test setName\r
87          */\r
88         @Test\r
89         public void testSetValue() {\r
90                 _taskVariableValue.setValue(_value);\r
91                 verify(_taskVariableValue).setValue(_value);\r
92         }\r
93         \r
94         /**\r
95          * Test of getName method\r
96          */\r
97         @Test\r
98         public void testGetOperator() {\r
99                 _taskVariableValue.setOperator(_operator);\r
100                 assertEquals(_taskVariableValue.getOperator(),_operator);\r
101 \r
102         }\r
103 \r
104         /**\r
105          * Test setName\r
106          */\r
107         @Test\r
108         public void testSetRequestDetails() {\r
109                 _taskVariableValue.setOperator(_operator);\r
110                 verify(_taskVariableValue).setOperator(_operator);\r
111         }\r
112 \r
113 }\r