4a616fbfb12bec9c509f9d0a8d3f779af9e9e636
[policy/drools-applications.git] / sdnc / src / test / java / org / openecomp / policy / sdnc / TestDemo.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * sdnc
4  * ================================================================================
5  * Copyright (C) 2017 AT&T 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  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.policy.sdnc;
22 import java.util.HashMap;
23 import java.util.Map;
24
25 import org.junit.Test;
26 import org.openecomp.policy.sdnc.SDNCRequest;
27 import org.openecomp.policy.sdnc.util.Serialization;
28
29 public class TestDemo {
30
31         @Test
32         public void test() {
33                 
34                 SDNCRequest request = new SDNCRequest();
35                 request.input = new SDNCRequestInput();
36                 request.input.requestHeader = new SDNCRequestHeader();
37                 request.input.vnfTopolgyInformation = new SDNCVnfTopologyInformation();
38                 request.input.vnfTopolgyInformation.vnfTopologyIdentifier = new SDNCVnfTopologyIdentifier();
39                 request.input.vnfTopolgyInformation.vnfAssignments = new SDNCVnfAssignments();
40                 request.input.requestInformation = new SDNCRequestInformation();
41                 
42                 request.input.vnfTopolgyInformation.vnfTopologyIdentifier.serviceType = "my_serviceType";
43                 request.input.vnfTopolgyInformation.vnfTopologyIdentifier.vnfName = "my_vnfName";
44                 request.input.vnfTopolgyInformation.vnfTopologyIdentifier.vnfType = "my_vnfType";
45                 request.input.vnfTopolgyInformation.vnfTopologyIdentifier.genericVnfName = "my_genericVnfName";
46                 request.input.vnfTopolgyInformation.vnfTopologyIdentifier.genericVnfType = "my_genericVnfType";
47                 
48                 request.input.vnfTopolgyInformation.vnfAssignments.availabilityZones.add("zone1");
49                 request.input.vnfTopolgyInformation.vnfAssignments.availabilityZones.add("zone2");
50                 request.input.vnfTopolgyInformation.vnfAssignments.vnfNetworks.add("network1");
51                 request.input.vnfTopolgyInformation.vnfAssignments.vnfNetworks.add("network2");
52                 request.input.vnfTopolgyInformation.vnfAssignments.vnfVms.add("vnfVm1");
53                 request.input.vnfTopolgyInformation.vnfAssignments.vnfVms.add("vnfVm2");
54                 
55                 Map<String, String> vnfParams1 = new HashMap<String, String>();
56                 vnfParams1.put("name1", "value1");
57                 request.input.vnfTopolgyInformation.vnfParameters.add(vnfParams1);
58
59                 Map<String, String> vnfParams2 = new HashMap<String, String>();
60                 vnfParams2.put("name2", "value2");
61                 request.input.vnfTopolgyInformation.vnfParameters.add(vnfParams2);
62                 
63                 
64                 request.input.requestInformation.requestId = "ff5256d1-5a33-55df-13ab-12abad84e7ff";
65                 request.input.requestInformation.orderNumber = "1";
66                 request.input.requestInformation.orderVersion = "1";
67                 request.input.requestInformation.notificationUrl = "sdnc.myDomain.com";
68                 request.input.requestInformation.requestAction = "PreloadVNFRequest";
69                 
70                 request.input.requestHeader.svcRequestId = "ff5256d1-5a33-55df-13ab-12abad84e7ff";
71                 request.input.requestHeader.svcNotificationUrl = "some_url.myDomain.com:8080";
72                 request.input.requestHeader.svcAction = "reserve";
73                 
74                 String body = Serialization.gsonPretty.toJson(request);
75                 System.out.println(body);
76                 
77                 
78                 
79         }
80
81 }