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 VariablesTest {
34 protected Value _source;
35 protected Value _responseValue;
36 protected Value _requestorId;
40 _variables = mock(Variables.class);
41 _source = mock(Value.class);
42 _responseValue = mock(Value.class);
43 _requestorId = mock(Value.class);
45 when(_variables.getSource()).thenReturn(_source);
46 when(_variables.getRequestorId()).thenReturn(_requestorId);
47 when(_variables.getResponseValue()).thenReturn(_responseValue);
52 public void tearDown() {
55 _responseValue = null;
60 public void testGetSource() {
61 _variables.setSource(_source);
62 assertTrue(_variables.getSource().equals(_source));
66 public void testSetSource(){
67 _variables.setSource(_source);
68 verify(_variables).setSource(_source);
72 public void testGetResponseValue() {
73 _variables.setResponseValue(_responseValue);
74 assertTrue(_variables.getResponseValue().equals(_responseValue));
78 public void testSetResponseValue(){
79 _variables.setResponseValue(_responseValue);
80 verify(_variables).setResponseValue(_responseValue);
84 public void testGetRequestorId() {
85 _variables.setRequestorId(_requestorId);
86 assertTrue(_variables.getRequestorId().equals(_requestorId));
90 public void testSetRequestorId(){
91 _variables.setRequestorId(_requestorId);
92 verify(_variables).setRequestorId(_requestorId);