Added New Junit Cases for APPC Design Services
[appc.git] / appc-inbound / appc-design-services / provider / src / test / java / org / openecomp / appc / design / validator / TestDesigndata.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APPC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Copyright (C) 2017 Amdocs
8  * =============================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  * 
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  * 
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * 
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  * ============LICENSE_END=========================================================
23  */
24
25 package org.openecomp.appc.design.validator;
26
27 import java.util.ArrayList;
28 import java.util.List;
29
30 import org.junit.Rule;
31 import org.junit.Test;
32 import org.mockito.Mock;
33 import org.mockito.Mockito;
34 import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev170627.DbserviceInput;
35 import org.openecomp.appc.design.data.ArtifactInfo;
36 import org.openecomp.appc.design.data.DesignInfo;
37 import org.openecomp.appc.design.data.DesignRequest;
38 import org.openecomp.appc.design.data.DesignResponse;
39 import org.openecomp.appc.design.data.StatusInfo;
40 import org.openecomp.appc.design.dbervices.DbResponseProcessor;
41 import org.openecomp.appc.design.dbervices.DbService;
42 import org.openecomp.appc.design.services.impl.DesignServicesImpl;
43 import org.openecomp.sdnc.sli.resource.dblib.DbLibService;
44
45 public class TestDesigndata {
46         
47         
48                 
49         DesignResponse dr = new DesignResponse();
50         
51         
52         
53         @Test
54         public void testSetUserID(){
55                 
56                  dr.setUserId("00000");
57                  
58                  String str = dr.getUserId();
59                  System.out.println(str);
60         }
61         
62         @Test
63         public void testSetDesignInfoList(){
64                 DesignInfo di = new DesignInfo();
65                 List<DesignInfo> li = new ArrayList<DesignInfo>();
66                 di.setAction("TestAction");
67                 di.setArtifact_name("TestName");
68                 di.setArtifact_type("TestType");
69                 di.setInCart("TestCart");
70                 di.setProtocol("TestProtocol");
71                 di.setVnf_type("TestVNF");
72                 di.setVnfc_type("TestVNFC");
73                 li.add(di);
74                 dr.setDesignInfoList(li);
75                 System.out.println(dr.getDesignInfoList());
76         }
77         
78         @Test
79         public void testSetArtifactInfo(){
80                 ArtifactInfo ai = new ArtifactInfo();
81                 List<ArtifactInfo> li = new ArrayList<ArtifactInfo>();
82                 ai.setArtifact_content("TestContent");
83                 li.add(ai);
84                 dr.setArtifactInfo(li);
85                 System.out.println(dr.getArtifactInfo());
86                 
87         }
88         @Test
89         public void testStatusInfo(){
90                 StatusInfo si = new StatusInfo();
91                 List<StatusInfo> li = new ArrayList<StatusInfo>();
92                 si.setAction("TestAction");
93                 si.setAction_status("TestActionStatus");
94                 si.setArtifact_status("TestArtifactStatus");
95                 si.setVnf_type("TestVNF");
96                 si.setVnfc_type("TestVNFC");
97                 li.add(si);
98                 dr.setStatusInfoList(li);
99                 System.out.println(dr.getStatusInfoList());
100         }
101         @Test
102         public void testDesignRequest(){
103                 DesignRequest dreq = new DesignRequest();
104                 dreq.setAction("TestAction");
105                 dreq.setArtifact_contents("TestContent");
106                 dreq.setArtifact_name("TestName");
107                 dreq.setProtocol("TestProtocol");
108                 dreq.setUserId("0000");
109                 dreq.setVnf_type("testvnf");
110                 dreq.setVnfc_type("testvnfc");
111                 System.out.println(dreq.getAction() + dreq.getArtifact_contents() + dreq.getArtifact_name() + dreq.getProtocol() + dreq.getUserId() + dreq.getVnf_type()+ dreq.getVnfc_type());
112         System.out.println(dreq.toString());
113         }
114         
115
116 }