2865c18e00e8fd818d8e2f323d4c7683ca6f4619
[appc.git] / appc-config / appc-flow-controller / provider / src / test / java / org / onap / appc / flow / controller / data / PreCheckTest.java
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * ONAP : APPC\r
4  * ================================================================================\r
5  * Copyright (C) 2018 AT&T Intellectual Property. 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  *\r
19  * ============LICENSE_END=========================================================\r
20  */\r
21 package org.onap.appc.flow.controller.data;\r
22 \r
23 import static org.junit.Assert.assertEquals;\r
24 import static org.junit.Assert.assertNotNull;\r
25 \r
26 import java.util.LinkedList;\r
27 import java.util.List;\r
28 \r
29 import org.junit.Before;\r
30 import org.junit.Test;\r
31 \r
32 public class PreCheckTest {\r
33     \r
34     private PreCheck preCheck;\r
35 \r
36     @Before\r
37     public void SetUp() {\r
38         preCheck = new PreCheck();\r
39     }\r
40 \r
41     @Test\r
42     public void testSetPrecheckOperator() {\r
43         preCheck.setPrecheckOperator("op");\r
44         assertNotNull(preCheck.getPrecheckOperator());\r
45         assertEquals(preCheck.getPrecheckOperator(),"op");\r
46     }\r
47 \r
48     @Test\r
49     public void testSetPrecheckOptions() {\r
50         List<PrecheckOption> precheckOptionList = new LinkedList<>();\r
51         preCheck.setPrecheckOptions(precheckOptionList);\r
52         assertNotNull(preCheck.getPrecheckOptions());\r
53         assertEquals(preCheck.getPrecheckOptions(), precheckOptionList);\r
54     }\r
55 \r
56     @Test\r
57     public void testHashCode() {\r
58         preCheck.setPrecheckOperator("1");\r
59         System.out.println(" precheck hashcode is "  + preCheck.hashCode());\r
60     }\r
61 \r
62     @Test\r
63     public void testToString() {\r
64         preCheck.setPrecheckOperator("A");\r
65         List<PrecheckOption> precheckOptionList = new LinkedList<>();\r
66         preCheck.setPrecheckOptions(precheckOptionList);\r
67         String ret = preCheck.toString();\r
68         System.out.println("ret is " + ret);\r
69 \r
70     }\r
71 \r
72 }\r