Added tests for appc.flow.ResponseAction
[appc.git] / appc-config / appc-flow-controller / provider / src / test / java / org / onap / appc / flow / controller / data / ResponseActionTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APPC
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
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  *
19  * ============LICENSE_END=========================================================
20  */
21 package org.onap.appc.flow.controller.data;
22
23 import org.junit.Assert;
24 import org.junit.Before;
25 import org.junit.Test;
26
27 public class ResponseActionTest {
28
29     private ResponseAction responseAction;
30
31     @Before
32     public void setUp() {
33         responseAction = new ResponseAction();
34     }
35
36     @Test
37     public void get_set_jump() {
38         String jump = "some_jump";
39         responseAction.setJump(jump);
40         Assert.assertEquals(jump, responseAction.getJump());
41     }
42
43     @Test
44     public void get_set_retry() {
45         String retry = "some_retry";
46         responseAction.setRetry(retry);
47         Assert.assertEquals(retry, responseAction.getRetry());
48     }
49
50     @Test
51     public void get_set_wait() {
52         String wait = "some_wait";
53         responseAction.setWait(wait);
54         Assert.assertEquals(wait, responseAction.getWait());
55     }
56
57     @Test
58     public void get_set_intermediate_message() {
59         responseAction.setIntermediateMessage(true);
60         Assert.assertTrue(responseAction.isIntermediateMessage());
61     }
62
63     @Test
64     public void get_set_ignore() {
65         responseAction.setIgnore(true);
66         Assert.assertTrue(responseAction.isIgnore());
67     }
68
69     @Test
70     public void get_set_stop() {
71         responseAction.setStop(true);
72         Assert.assertTrue(responseAction.isStop());
73     }
74
75     @Test
76     public void to_string() {
77         responseAction.setStop(true);
78         responseAction.setIntermediateMessage(true);
79         responseAction.setIgnore(true);
80         responseAction.setJump("some_jump");
81         responseAction.setRetry("some_retry");
82         responseAction.setWait("some_wait");
83         Assert.assertEquals(
84             "ResponseAction [wait=some_wait, retry=some_retry, jump=some_jump, ignore=true, stop=true, intermediateMessage=true]",
85             responseAction.toString());
86     }
87
88 }