2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2018 Nokia Intellectual Property. 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.
19 * ============LICENSE_END=========================================================
21 package org.onap.appc.flow.controller.data;
23 import static org.mockito.Mockito.mock;
24 import static org.mockito.Mockito.when;
26 import org.junit.Assert;
27 import org.junit.Before;
28 import org.junit.Test;
30 public class ResponseTest {
32 private Response response;
36 response = new Response();
40 public void get_set_response_action() {
41 ResponseAction ra = mock(ResponseAction.class);
42 response.setResponseAction(ra);
43 Assert.assertEquals(ra, response.getResponseAction());
47 public void get_set_response_action_handler() {
48 String rah = "response_action_handler";
49 response.setResponseActionHanlder(rah);
50 Assert.assertEquals(rah, response.getResponseActionHanlder());
54 public void get_set_response_code() {
55 String responseCode = "response_code";
56 response.setResponseCode(responseCode);
57 Assert.assertEquals(responseCode, response.getResponseCode());
61 public void get_set_response_message() {
62 String responseMessage = "response_message";
63 response.setResponseMessage(responseMessage);
64 Assert.assertEquals(responseMessage, response.getResponseMessage());
68 public void to_string() {
69 response.setResponseCode("code");
70 response.setResponseMessage("msg");
71 response.setResponseActionHanlder("rah");
73 ResponseAction ra = mock(ResponseAction.class);
74 when(ra.toString()).thenReturn("ra-toString");
76 response.setResponseAction(ra);
79 "Response [responseCode=code, responseMessage=msg, responseAction=ra-toString, responseActionHanlder=rah]",