2 * ============LICENSE_START=======================================================
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
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.onap.so.apihandlerinfra.tasksbeans;
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;
31 public class TaskVariableValueTest {
32 TaskVariableValue _taskVariableValue;
33 protected String _name;
34 protected String _value;
35 protected String _operator;
37 public TaskVariableValueTest() {
42 _taskVariableValue = mock(TaskVariableValue.class);
45 _operator = "operator";
46 when(_taskVariableValue.getName()).thenReturn(_name);
47 when(_taskVariableValue.getValue()).thenReturn(_value);
48 when(_taskVariableValue.getOperator()).thenReturn(_operator);
52 public void tearDown() {
53 _taskVariableValue = null;
57 * Test of getName method
60 public void testGetName() {
61 _taskVariableValue.setName(_name);
62 assertEquals(_taskVariableValue.getName(),_name);
70 public void testSetName() {
71 _taskVariableValue.setName(_name);
72 verify(_taskVariableValue).setName(_name);
76 * Test of getName method
79 public void testGetValue() {
80 _taskVariableValue.setValue(_value);
81 assertEquals(_taskVariableValue.getValue(),_value);
89 public void testSetValue() {
90 _taskVariableValue.setValue(_value);
91 verify(_taskVariableValue).setValue(_value);
95 * Test of getName method
98 public void testGetOperator() {
99 _taskVariableValue.setOperator(_operator);
100 assertEquals(_taskVariableValue.getOperator(),_operator);
108 public void testSetRequestDetails() {
109 _taskVariableValue.setOperator(_operator);
110 verify(_taskVariableValue).setOperator(_operator);