Fixing XML parsers sonar issue
[so.git] / bpmn / MSOCommonBPMN / src / test / groovy / org / onap / so / bpmn / common / scripts / SDNCAdapterTest.groovy
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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.onap.so.bpmn.common.scripts
22
23
24 import static org.mockito.Mockito.*
25 import org.camunda.bpm.engine.ProcessEngineServices
26 import org.camunda.bpm.engine.RepositoryService
27 import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
28 import org.camunda.bpm.engine.repository.ProcessDefinition
29 import org.junit.Before
30 import org.junit.Test
31 import org.junit.runner.RunWith
32 import org.mockito.MockitoAnnotations
33 import org.mockito.junit.MockitoJUnitRunner;
34 import org.mockito.internal.debugging.MockitoDebuggerImpl
35 import org.onap.so.bpmn.common.scripts.SDNCAdapter;
36
37 import org.onap.so.bpmn.mock.FileUtil
38
39 @RunWith(MockitoJUnitRunner.Silent.class)
40 public class SDNCAdapterTest {
41
42         @Before
43         public void init()
44         {
45                 MockitoAnnotations.initMocks(this)
46                 System.setProperty("jboss.qualified.host.name","myhost.com")
47         }
48
49
50         String workflowResponse = """<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns="com:att:sdnctl:l3api"
51                                                  xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1"
52                                                  xmlns:tag0="http://org.onap/workflow/sdnc/adapter/schema/v1"
53                                                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
54    <sdncadapterworkflow:response-data>
55       <tag0:CallbackHeader>
56          <tag0:RequestId>testRequestId</tag0:RequestId>
57          <tag0:ResponseCode>200</tag0:ResponseCode>
58          <tag0:ResponseMessage>OK</tag0:ResponseMessage>
59       </tag0:CallbackHeader>
60       <tag0:RequestData xsi:type="xs:string">
61          <layer3-service-list>
62             <service-instance-id>FK/VLXM/003717//SW_INTERNET</service-instance-id>
63             <service-status>
64                <rpc-name>service-configuration-operation</rpc-name>
65                <rpc-action>activate</rpc-action>
66                <request-status>synccomplete</request-status>
67                <final-indicator>N</final-indicator>
68                <l3sdn-action>Layer3ServiceActivateRequest</l3sdn-action>
69                <l3sdn-subaction>SUPP</l3sdn-subaction>
70                <response-timestamp>2015-04-28T21:32:11.386Z</response-timestamp>
71             </service-status>
72             <service-data>
73                <internet-evc-access-information>
74                   <ip-version>ds</ip-version>
75                   <internet-evc-speed-value>8</internet-evc-speed-value>
76                   <internet-evc-speed-units>Mbps</internet-evc-speed-units>
77                </internet-evc-access-information>
78                <vr-lan>
79                   <vr-lan-interface>
80                      <static-routes>
81                         <v6-static-routes>
82                            <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
83                            <v6-static-route-prefix>2001:1890:12e3:2da::</v6-static-route-prefix>
84                            <v6-static-route-prefix-length>28</v6-static-route-prefix-length>
85                         </v6-static-routes>
86                         <v4-static-routes>
87                            <v4-static-route-prefix>255.255.252.1</v4-static-route-prefix>
88                            <v4-next-hop-address>192.168.1.15</v4-next-hop-address>
89                            <v4-static-route-prefix-length>28</v4-static-route-prefix-length>
90                         </v4-static-routes>
91                         <v6-static-routes>
92                            <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
93                            <v6-static-route-prefix>2001:1890:12e3:2da::</v6-static-route-prefix>
94                            <v6-static-route-prefix-length>28</v6-static-route-prefix-length>
95                         </v6-static-routes>
96                         <v4-static-routes>
97                            <v4-static-route-prefix>255.255.252.2</v4-static-route-prefix>
98                            <v4-next-hop-address>192.168.1.15</v4-next-hop-address>
99                            <v4-static-route-prefix-length>28</v4-static-route-prefix-length>
100                         </v4-static-routes>
101                         <v4-static-routes>
102                            <v4-static-route-prefix>255.255.252.3</v4-static-route-prefix>
103                            <v4-next-hop-address>192.168.1.15</v4-next-hop-address>
104                            <v4-static-route-prefix-length>28</v4-static-route-prefix-length>
105                         </v4-static-routes>
106                      </static-routes>
107                      <dhcp>
108                         <v6-dhcp-server-enabled>N</v6-dhcp-server-enabled>
109                         <v4-dhcp-server-enabled>Y</v4-dhcp-server-enabled>
110                         <use-v6-default-pool>N</use-v6-default-pool>
111                         <excluded-v4-dhcp-addresses-from-default-pool>
112                            <excluded-v4-address>192.168.1.7</excluded-v4-address>
113                         </excluded-v4-dhcp-addresses-from-default-pool>
114                         <excluded-v4-dhcp-addresses-from-default-pool>
115                            <excluded-v4-address>192.168.1.8</excluded-v4-address>
116                         </excluded-v4-dhcp-addresses-from-default-pool>
117                         <v4-dhcp-pools>
118                            <v4-dhcp-relay-next-hop-address>1.1.1.1</v4-dhcp-relay-next-hop-address>
119                            <v4-dhcp-pool-prefix-length>28</v4-dhcp-pool-prefix-length>
120                            <excluded-v4-addresses>
121                               <excluded-v4-address>192.168.1.5</excluded-v4-address>
122                            </excluded-v4-addresses>
123                            <v4-dhcp-relay-gateway-address>2.2.2.1</v4-dhcp-relay-gateway-address>
124                            <excluded-v4-addresses>
125                               <excluded-v4-address>192.168.1.6</excluded-v4-address>
126                            </excluded-v4-addresses>
127                            <v4-dhcp-pool-prefix>192.155.2.3</v4-dhcp-pool-prefix>
128                         </v4-dhcp-pools>
129                         <v4-dhcp-pools>
130                            <v4-dhcp-relay-next-hop-address>1.1.1.2</v4-dhcp-relay-next-hop-address>
131                            <v4-dhcp-pool-prefix-length>28</v4-dhcp-pool-prefix-length>
132                            <excluded-v4-addresses>
133                               <excluded-v4-address>192.168.1.6</excluded-v4-address>
134                            </excluded-v4-addresses>
135                            <v4-dhcp-relay-gateway-address>2.2.2.2</v4-dhcp-relay-gateway-address>
136                            <excluded-v4-addresses>
137                               <excluded-v4-address>192.168.1.7</excluded-v4-address>
138                            </excluded-v4-addresses>
139                            <v4-dhcp-pool-prefix>192.155.2.4</v4-dhcp-pool-prefix>
140                         </v4-dhcp-pools>
141                         <use-v4-default-pool>Y</use-v4-default-pool>
142                         <excluded-v6-dhcp-addresses-from-default-pool>
143                            <excluded-v6-address>1:5</excluded-v6-address>
144                         </excluded-v6-dhcp-addresses-from-default-pool>
145                         <excluded-v6-dhcp-addresses-from-default-pool>
146                            <excluded-v6-address>1:6</excluded-v6-address>
147                         </excluded-v6-dhcp-addresses-from-default-pool>
148                         <v6-dhcp-pools>
149                            <v6-dhcp-relay-next-hop-address>4:4</v6-dhcp-relay-next-hop-address>
150                            <v6-dhcp-pool-prefix-length>28</v6-dhcp-pool-prefix-length>
151                            <excluded-v6-addresses>
152                               <excluded-v6-address>1:1</excluded-v6-address>
153                            </excluded-v6-addresses>
154                            <v6-dhcp-relay-gateway-address>3:3</v6-dhcp-relay-gateway-address>
155                            <excluded-v6-addresses>
156                               <excluded-v6-address>2:2</excluded-v6-address>
157                            </excluded-v6-addresses>
158                            <v6-dhcp-pool-prefix>0:0</v6-dhcp-pool-prefix>
159                         </v6-dhcp-pools>
160                         <v6-dhcp-pools>
161                            <v6-dhcp-relay-next-hop-address>4:4</v6-dhcp-relay-next-hop-address>
162                            <v6-dhcp-pool-prefix-length>28</v6-dhcp-pool-prefix-length>
163                            <excluded-v6-addresses>
164                               <excluded-v6-address>1:1</excluded-v6-address>
165                            </excluded-v6-addresses>
166                            <v6-dhcp-relay-gateway-address>3:3</v6-dhcp-relay-gateway-address>
167                            <excluded-v6-addresses>
168                               <excluded-v6-address>2:2</excluded-v6-address>
169                            </excluded-v6-addresses>
170                            <v6-dhcp-pool-prefix>0:0</v6-dhcp-pool-prefix>
171                         </v6-dhcp-pools>
172                      </dhcp>
173                      <firewall-lite>
174                         <stateful-firewall-lite-v6-enabled>N</stateful-firewall-lite-v6-enabled>
175                         <stateful-firewall-lite-v4-enabled>Y</stateful-firewall-lite-v4-enabled>
176                         <v4-firewall-packet-filters>
177                            <v4-firewall-prefix>0.0.0.1</v4-firewall-prefix>
178                            <v4-firewall-prefix-length>1</v4-firewall-prefix-length>
179                            <allow-icmp-ping>Y</allow-icmp-ping>
180                            <udp-ports>
181                               <port-number>1</port-number>
182                            </udp-ports>
183                            <tcp-ports>
184                               <port-number>1</port-number>
185                            </tcp-ports>
186                         </v4-firewall-packet-filters>
187                         <v4-firewall-packet-filters>
188                            <v4-firewall-prefix>0.0.0.2</v4-firewall-prefix>
189                            <v4-firewall-prefix-length>2</v4-firewall-prefix-length>
190                            <allow-icmp-ping>Y</allow-icmp-ping>
191                            <udp-ports>
192                               <port-number>2</port-number>
193                            </udp-ports>
194                            <tcp-ports>
195                               <port-number>2</port-number>
196                            </tcp-ports>
197                         </v4-firewall-packet-filters>
198                         <v6-firewall-packet-filters>
199                            <v6-firewall-prefix>:</v6-firewall-prefix>
200                            <v6-firewall-prefix-length>0</v6-firewall-prefix-length>
201                            <allow-icmp-ping>Y</allow-icmp-ping>
202                            <udp-ports>
203                               <port-number>3</port-number>
204                            </udp-ports>
205                            <tcp-ports>
206                               <port-number>3</port-number>
207                            </tcp-ports>
208                         </v6-firewall-packet-filters>
209                         <v6-firewall-packet-filters>
210                            <v6-firewall-prefix>:</v6-firewall-prefix>
211                            <v6-firewall-prefix-length>1</v6-firewall-prefix-length>
212                            <allow-icmp-ping>Y</allow-icmp-ping>
213                            <udp-ports>
214                               <port-number>4</port-number>
215                            </udp-ports>
216                            <tcp-ports>
217                               <port-number>4</port-number>
218                            </tcp-ports>
219                         </v6-firewall-packet-filters>
220                      </firewall-lite>
221                      <pat>
222                         <v4-pat-pools>
223                            <v4-pat-pool-prefix>192.168.1.44</v4-pat-pool-prefix>
224                            <v4-pat-pool-next-hop-address>192.168.1.5</v4-pat-pool-next-hop-address>
225                            <v4-pat-pool-prefix-length>0</v4-pat-pool-prefix-length>
226                         </v4-pat-pools>
227                         <use-v4-default-pool>Y</use-v4-default-pool>
228                         <v4-pat-enabled>N</v4-pat-enabled>
229                         <v4-pat-pools>
230                            <v4-pat-pool-prefix>192.168.1.45</v4-pat-pool-prefix>
231                            <v4-pat-pool-next-hop-address>192.168.1.6</v4-pat-pool-next-hop-address>
232                            <v4-pat-pool-prefix-length>28</v4-pat-pool-prefix-length>
233                         </v4-pat-pools>
234                      </pat>
235                      <nat>
236                         <v4-nat-enabled>Y</v4-nat-enabled>
237                         <v4-nat-mapping-entries>
238                            <v4-nat-internal>0.0.0.0</v4-nat-internal>
239                            <v4-nat-next-hop-address>0.0.0.0</v4-nat-next-hop-address>
240                            <v4-nat-external>0.0.0.0</v4-nat-external>
241                         </v4-nat-mapping-entries>
242                         <v4-nat-mapping-entries>
243                            <v4-nat-internal>0.0.0.1</v4-nat-internal>
244                            <v4-nat-next-hop-address>0.0.0.1</v4-nat-next-hop-address>
245                            <v4-nat-external>0.0.0.1</v4-nat-external>
246                         </v4-nat-mapping-entries>
247                      </nat>
248                      <vr-designation>primary</vr-designation>
249                      <v4-vce-loopback-address>162.200.3.144</v4-vce-loopback-address>
250                      <v6-vr-lan-prefix-length>64</v6-vr-lan-prefix-length>
251                      <v6-vce-wan-address>2001:1890:12e3:2da::</v6-vce-wan-address>
252                      <v6-vr-lan-prefix>2620:0:10d0:f:ffff:ffff:ffff:fffe</v6-vr-lan-prefix>
253                      <v4-vr-lan-prefix-length>24</v4-vr-lan-prefix-length>
254                      <v4-vr-lan-prefix>10.192.27.254</v4-vr-lan-prefix>
255                      <v4-public-lan-prefixes>
256                         <t-provided-v4-lan-public-prefixes>
257                            <request-index>1</request-index>
258                            <v4-next-hop-address>192.168.1.2</v4-next-hop-address>
259                            <v4-lan-public-prefix>192.168.1.1</v4-lan-public-prefix>
260                            <v4-lan-public-prefix-length>28</v4-lan-public-prefix-length>
261                         </t-provided-v4-lan-public-prefixes>
262                         <t-provided-v4-lan-public-prefixes>
263                            <request-index>1</request-index>
264                            <v4-next-hop-address>192.168.1.72</v4-next-hop-address>
265                            <v4-lan-public-prefix>192.168.1.71</v4-lan-public-prefix>
266                            <v4-lan-public-prefix-length>28</v4-lan-public-prefix-length>
267                         </t-provided-v4-lan-public-prefixes>
268                         <t-provided-v4-lan-public-prefixes>
269                            <request-index>1</request-index>
270                            <v4-next-hop-address>192.168.1.68</v4-next-hop-address>
271                            <v4-lan-public-prefix>192.168.1.67</v4-lan-public-prefix>
272                            <v4-lan-public-prefix-length>28</v4-lan-public-prefix-length>
273                         </t-provided-v4-lan-public-prefixes>
274                      </v4-public-lan-prefixes>
275                      <v6-public-lan-prefixes>
276                         <t-provided-v6-lan-public-prefixes>
277                            <request-index>1</request-index>
278                            <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
279                            <v6-lan-public-prefix>2001:1890:12e3:2da::</v6-lan-public-prefix>
280                            <v6-lan-public-prefix-length>28</v6-lan-public-prefix-length>
281                         </t-provided-v6-lan-public-prefixes>
282                         <t-provided-v6-lan-public-prefixes>
283                            <request-index>1</request-index>
284                            <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
285                            <v6-lan-public-prefix>2001:1890:12e3:3da::</v6-lan-public-prefix>
286                            <v6-lan-public-prefix-length>28</v6-lan-public-prefix-length>
287                         </t-provided-v6-lan-public-prefixes>
288                         <t-provided-v6-lan-public-prefixes>
289                            <request-index>1</request-index>
290                            <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
291                            <v6-lan-public-prefix>2001:1890:12e3:4da::</v6-lan-public-prefix>
292                            <v6-lan-public-prefix-length>28</v6-lan-public-prefix-length>
293                         </t-provided-v6-lan-public-prefixes>
294                      </v6-public-lan-prefixes>
295                   </vr-lan-interface>
296                   <routing-protocol>none</routing-protocol>
297                </vr-lan>
298                <ucpe-vms-service-information>
299                   <transport-service-information>
300                      <transport-service-type>AVPN</transport-service-type>
301                      <access-circuit-info>
302                         <access-circuit-id>1</access-circuit-id>
303                         <dual-mode>Active</dual-mode>
304                      </access-circuit-info>
305                      <access-circuit-info>
306                         <access-circuit-id>2</access-circuit-id>
307                         <dual-mode>Standby</dual-mode>
308                      </access-circuit-info>
309                   </transport-service-information>
310                   <ucpe-information>
311                      <ucpe-host-name>hostname</ucpe-host-name>
312                      <ucpe-activation-code>activecode</ucpe-activation-code>
313                      <out-of-band-management-modem>OOB</out-of-band-management-modem>
314                   </ucpe-information>
315                   <vnf-list>
316                      <vnf-information>
317                         <vnf-instance-id>1</vnf-instance-id>
318                         <vnf-sequence-number>1</vnf-sequence-number>
319                         <vnf-type>ZZ</vnf-type>
320                         <vnf-vendor>JUNIPER</vnf-vendor>
321                         <vnf-model>MODEL1</vnf-model>
322                         <vnf-id>1</vnf-id>
323                         <prov-status>1</prov-status>
324                         <operational-state>1</operational-state>
325                         <orchestration-status>1</orchestration-status>
326                         <equipment-role>1</equipment-role>
327                      </vnf-information>
328                      <vnf-information>
329                         <vnf-instance-id>2</vnf-instance-id>
330                         <vnf-sequence-number>2</vnf-sequence-number>
331                         <vnf-type>HY</vnf-type>
332                         <vnf-vendor>JUNIPER</vnf-vendor>
333                         <vnf-model>MODEL2</vnf-model>
334                         <vnf-id>2</vnf-id>
335                         <prov-status>2</prov-status>
336                         <operational-state>2</operational-state>
337                         <orchestration-status>2</orchestration-status>
338                         <equipment-role>2</equipment-role>
339                      </vnf-information>
340                   </vnf-list>
341                </ucpe-vms-service-information>
342                <request-information>
343                   <request-action>Layer3ServiceActivateRequest</request-action>
344                   <order-number>4281555</order-number>
345                   <request-id>155415ab-b4a7-4382-b4c6-d17d9sm42855</request-id>
346                   <notification-url>https://csi-tst-q22.it.com:22443/Services/com/cingular/csi/sdn/SendManagedNetworkStatusNotification.jws</notification-url>
347                   <source>OMX</source>
348                   <order-version>1</order-version>
349                </request-information>
350                <sdnc-request-header>
351                   <svc-action>activate</svc-action>
352                   <svc-notification-url>https://localhost:8443/adapters/rest/SDNCNotify</svc-notification-url>
353                   <svc-request-id>5b1f3c5d-cdf9-488d-8a4b-d3f1229d7760</svc-request-id>
354                </sdnc-request-header>
355                <l2-homing-information>
356                   <topology>MultiPoint</topology>
357                   <preferred-aic-clli>MTSNJA4LCP1</preferred-aic-clli>
358                   <evc-name>AS/VLXM/003717//SW</evc-name>
359                </l2-homing-information>
360                <service-information>
361                   <service-instance-id>FK/VLXM/003717//SW_INTERNET</service-instance-id>
362                   <subscriber-name>ST E2E Test42855_1300004281555</subscriber-name>
363                   <service-type>SDN-ETHERNET-INTERNET</service-type>
364                </service-information>
365                <internet-service-change-details>
366                   <internet-evc-speed-value>10</internet-evc-speed-value>
367                   <internet-evc-speed-units>Kbps</internet-evc-speed-units>
368                   <t-provided-v4-lan-public-prefixes>
369                      <request-index>1</request-index>
370                      <v4-next-hop-address>192.168.1.15</v4-next-hop-address>
371                      <v4-lan-public-prefix>192.168.1.15</v4-lan-public-prefix>
372                      <v4-lan-public-prefix-length>28</v4-lan-public-prefix-length>
373                   </t-provided-v4-lan-public-prefixes>
374                   <t-provided-v4-lan-public-prefixes>
375                      <request-index>2</request-index>
376                      <v4-next-hop-address>192.168.1.16</v4-next-hop-address>
377                      <v4-lan-public-prefix>192.168.1.16</v4-lan-public-prefix>
378                      <v4-lan-public-prefix-length>28</v4-lan-public-prefix-length>
379                   </t-provided-v4-lan-public-prefixes>
380                   <t-provided-v6-lan-public-prefixes>
381                      <request-index>1</request-index>
382                      <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
383                      <v6-lan-public-prefix>2001:1890:12e3:2da::</v6-lan-public-prefix>
384                      <v6-lan-public-prefix-length>28</v6-lan-public-prefix-length>
385                   </t-provided-v6-lan-public-prefixes>
386                   <t-provided-v6-lan-public-prefixes>
387                      <request-index>1</request-index>
388                      <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
389                      <v6-lan-public-prefix>2001:1890:12e3:2da::</v6-lan-public-prefix>
390                      <v6-lan-public-prefix-length>28</v6-lan-public-prefix-length>
391                   </t-provided-v6-lan-public-prefixes>
392                </internet-service-change-details>
393             </service-data>
394          </layer3-service-list>
395       </tag0:RequestData>
396    </sdncadapterworkflow:response-data>
397 </sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
398
399         String sdncAdapterRequest = """
400                         <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
401                         <SOAP-ENV:Body>
402                         <aetgt:SDNCAdapterRequest xmlns:aetgt="http://org.onap/workflow/sdnc/adapter/schema/v1" xmlns:sdncadaptersc="http://org.onap/workflow/sdnc/adapter/schema/v1">
403                         <sdncadapter:RequestHeader xmlns:sdncadapter="http://org.onap/workflow/sdnc/adapter/schema/v1">
404                         <sdncadapter:RequestId>745b1b50-e39e-4685-9cc8-c71f0bde8bf0</sdncadapter:RequestId>
405                         <sdncadapter:SvcAction>query</sdncadapter:SvcAction>
406                         <sdncadapter:SvcOperation>services/layer3-service-list/AS%2FVLXM%2F000199%2F%2FSB_INTERNET</sdncadapter:SvcOperation>
407                         <sdncadapter:CallbackUrl>http://myhost.com:28080/mso/sdncAdapterCallbackServiceImpl</sdncadapter:CallbackUrl>
408                         </sdncadapter:RequestHeader>
409                         <sdncadaptersc:RequestData>
410                                 <rest:payload xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"
411               contentType="text/xml">
412    <service-request xmlns="http://org.onap/so/request/details/schema/v1">
413       <request-information>
414          <request-id>12570a36-7388-4c0a-bec4-189ce3kg9956</request-id>
415          <request-action>GetLayer3ServiceDetailsRequest</request-action>
416          <source>OMX</source>
417       </request-information>
418       <service-information>
419          <service-type>SDN-ETHERNET-INTERNET</service-type>
420          <service-instance-id>PD/VLXM/003717//SW_INTERNET</service-instance-id>
421       </service-information>
422    </service-request>
423 </rest:payload>
424                         </sdncadaptersc:RequestData></aetgt:SDNCAdapterRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>"""
425
426 String sdncAdapterResponse = """<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1">
427 <sdncadapterworkflow:response-data>
428 <tag0:CallbackHeader xmlns:tag0="http://org.onap/workflow/sdnc/adapter/schema/v1">
429    <tag0:RequestId>39542e39-ccc3-4d1a-8b79-04ce88526613</tag0:RequestId>
430    <tag0:ResponseCode>404</tag0:ResponseCode>
431    <tag0:ResponseMessage>Error processing request to SDNC. Not Found.
432                         https://localhost:8443/restconf/config/L3SDN-API:services/layer3-service-list/MVM%2FVLXP%2F000855%2F%2FShakeout.
433                         SDNC Returned-[error-type:application, error-tag:data-missing,
434                         error-message:Request could not be completed because the relevant
435                         data model content does not exist.]</tag0:ResponseMessage>
436 </tag0:CallbackHeader>
437 </sdncadapterworkflow:response-data>
438 </sdncadapterworkflow:SDNCAdapterWorkflowResponse>
439 """
440
441 String workflowErrorResponse = """<aetgt:WorkflowException xmlns:aetgt="http://org.onap/so/workflow/schema/v1">
442                                                                 <aetgt:ErrorMessage>Received error from SDN-C: Error processing request to SDNC. Not Found.
443                         https://localhost:8443/restconf/config/L3SDN-API:services/layer3-service-list/MVM%2FVLXP%2F000855%2F%2FShakeout.
444                         SDNC Returned-[error-type:application, error-tag:data-missing,
445                         error-message:Request could not be completed because the relevant
446                         data model content does not exist.]</aetgt:ErrorMessage>
447                                                                 <aetgt:ErrorCode>5300</aetgt:ErrorCode>
448                                                                 <aetgt:SourceSystemErrorCode>404</aetgt:SourceSystemErrorCode>
449                                                                 </aetgt:WorkflowException>"""
450
451 String workflowErrorResponse1 = """<aetgt:WorkflowException xmlns:aetgt="http://org.onap/so/workflow/schema/v1">
452                                         <aetgt:ErrorMessage>Invalid Callback Response from SDNC Adapter</aetgt:ErrorMessage>
453                                         <aetgt:ErrorCode>5300</aetgt:ErrorCode>
454                                   </aetgt:WorkflowException>"""
455
456 String     enhancedCallbackRequestData =
457     """<tag0:RequestData xmlns:tag0="http://org.onap/workflow/sdnc/adapter/schema/v1"
458                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
459                   xsi:type="xs:string">                         <layer3-service-list xmlns="com:att:sdnctl:l3api">
460                                         <service-instance-id>FK/VLXM/003717//SW_INTERNET</service-instance-id>
461                                         <service-status>
462                                                 <rpc-name>service-configuration-operation</rpc-name>
463                                                 <rpc-action>activate</rpc-action>
464                                                 <request-status>synccomplete</request-status>
465                                                 <final-indicator>N</final-indicator>
466                                                 <l3sdn-action>Layer3ServiceActivateRequest</l3sdn-action>
467                                                 <l3sdn-subaction>SUPP</l3sdn-subaction>
468                                                 <response-timestamp>2015-04-28T21:32:11.386Z</response-timestamp>
469                                         </service-status>
470                                         <service-data>
471                                                 <internet-evc-access-information>
472                                                         <ip-version>ds</ip-version>
473                                                         <internet-evc-speed-value>8</internet-evc-speed-value>
474                                                         <internet-evc-speed-units>Mbps</internet-evc-speed-units>
475                                                 </internet-evc-access-information>
476                                                 <vr-lan xmlns="com:att:sdnctl:l3api">
477                                                         <vr-lan-interface>
478                                                                 <static-routes>
479                                                                         <v6-static-routes>
480                                                                                 <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
481                                                                                 <v6-static-route-prefix>2001:1890:12e3:2da::</v6-static-route-prefix>
482                                                                                 <v6-static-route-prefix-length>28</v6-static-route-prefix-length>
483                                                                         </v6-static-routes>
484                                                                         <v4-static-routes>
485                                                                                 <v4-static-route-prefix>255.255.252.1</v4-static-route-prefix>
486                                                                                 <v4-next-hop-address>192.168.1.15</v4-next-hop-address>
487                                                                                 <v4-static-route-prefix-length>28</v4-static-route-prefix-length>
488                                                                         </v4-static-routes>
489                                                                         <v6-static-routes>
490                                                                                 <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
491                                                                                 <v6-static-route-prefix>2001:1890:12e3:2da::</v6-static-route-prefix>
492                                                                                 <v6-static-route-prefix-length>28</v6-static-route-prefix-length>
493                                                                         </v6-static-routes>
494                                                                         <v4-static-routes>
495                                                                                 <v4-static-route-prefix>255.255.252.2</v4-static-route-prefix>
496                                                                                 <v4-next-hop-address>192.168.1.15</v4-next-hop-address>
497                                                                                 <v4-static-route-prefix-length>28</v4-static-route-prefix-length>
498                                                                         </v4-static-routes>
499                                                                         <v4-static-routes>
500                                                                                 <v4-static-route-prefix>255.255.252.3</v4-static-route-prefix>
501                                                                                 <v4-next-hop-address>192.168.1.15</v4-next-hop-address>
502                                                                                 <v4-static-route-prefix-length>28</v4-static-route-prefix-length>
503                                                                         </v4-static-routes>
504                                                                 </static-routes>
505                                                                 <dhcp>
506                                                                         <v6-dhcp-server-enabled>N</v6-dhcp-server-enabled>
507                                                                         <v4-dhcp-server-enabled>Y</v4-dhcp-server-enabled>
508                                                                         <use-v6-default-pool>N</use-v6-default-pool>
509                                                                         <excluded-v4-dhcp-addresses-from-default-pool>
510                                                                           <excluded-v4-address>192.168.1.7</excluded-v4-address>
511                                                                         </excluded-v4-dhcp-addresses-from-default-pool>
512                                                                         <excluded-v4-dhcp-addresses-from-default-pool>
513                                                                           <excluded-v4-address>192.168.1.8</excluded-v4-address>
514                                                                         </excluded-v4-dhcp-addresses-from-default-pool>
515                                                                         <v4-dhcp-pools>
516                                                                                 <v4-dhcp-relay-next-hop-address>1.1.1.1</v4-dhcp-relay-next-hop-address>
517                                                                                 <v4-dhcp-pool-prefix-length>28</v4-dhcp-pool-prefix-length>
518                                                                                 <excluded-v4-addresses>
519                                                                                         <excluded-v4-address>192.168.1.5</excluded-v4-address>
520                                                                                 </excluded-v4-addresses>
521                                                                                 <v4-dhcp-relay-gateway-address>2.2.2.1</v4-dhcp-relay-gateway-address>
522                                                                                 <excluded-v4-addresses>
523                                                                                         <excluded-v4-address>192.168.1.6</excluded-v4-address>
524                                                                                 </excluded-v4-addresses>
525                                                                                 <v4-dhcp-pool-prefix>192.155.2.3</v4-dhcp-pool-prefix>
526                                                                         </v4-dhcp-pools>
527                                                                         <v4-dhcp-pools>
528                                                                                 <v4-dhcp-relay-next-hop-address>1.1.1.2</v4-dhcp-relay-next-hop-address>
529                                                                                 <v4-dhcp-pool-prefix-length>28</v4-dhcp-pool-prefix-length>
530                                                                                 <excluded-v4-addresses>
531                                                                                         <excluded-v4-address>192.168.1.6</excluded-v4-address>
532                                                                                 </excluded-v4-addresses>
533                                                                                 <v4-dhcp-relay-gateway-address>2.2.2.2</v4-dhcp-relay-gateway-address>
534                                                                                 <excluded-v4-addresses>
535                                                                                         <excluded-v4-address>192.168.1.7</excluded-v4-address>
536                                                                                 </excluded-v4-addresses>
537                                                                                 <v4-dhcp-pool-prefix>192.155.2.4</v4-dhcp-pool-prefix>
538                                                                         </v4-dhcp-pools>
539                                                                         <use-v4-default-pool>Y</use-v4-default-pool>
540                                                                         <excluded-v6-dhcp-addresses-from-default-pool>
541                                                                           <excluded-v6-address>1:5</excluded-v6-address>
542                                                                         </excluded-v6-dhcp-addresses-from-default-pool>
543                                                                         <excluded-v6-dhcp-addresses-from-default-pool>
544                                                                           <excluded-v6-address>1:6</excluded-v6-address>
545                                                                         </excluded-v6-dhcp-addresses-from-default-pool>
546                                                                         <v6-dhcp-pools>
547                                                                                 <v6-dhcp-relay-next-hop-address>4:4</v6-dhcp-relay-next-hop-address>
548                                                                                 <v6-dhcp-pool-prefix-length>28</v6-dhcp-pool-prefix-length>
549                                                                                 <excluded-v6-addresses>
550                                                                                         <excluded-v6-address>1:1</excluded-v6-address>
551                                                                                 </excluded-v6-addresses>
552                                                                                 <v6-dhcp-relay-gateway-address>3:3</v6-dhcp-relay-gateway-address>
553                                                                                 <excluded-v6-addresses>
554                                                                                         <excluded-v6-address>2:2</excluded-v6-address>
555                                                                                 </excluded-v6-addresses>
556                                                                                 <v6-dhcp-pool-prefix>0:0</v6-dhcp-pool-prefix>
557                                                                         </v6-dhcp-pools>
558                                                                         <v6-dhcp-pools>
559                                                                                 <v6-dhcp-relay-next-hop-address>4:4</v6-dhcp-relay-next-hop-address>
560                                                                                 <v6-dhcp-pool-prefix-length>28</v6-dhcp-pool-prefix-length>
561                                                                                 <excluded-v6-addresses>
562                                                                                         <excluded-v6-address>1:1</excluded-v6-address>
563                                                                                 </excluded-v6-addresses>
564                                                                                 <v6-dhcp-relay-gateway-address>3:3</v6-dhcp-relay-gateway-address>
565                                                                                 <excluded-v6-addresses>
566                                                                                         <excluded-v6-address>2:2</excluded-v6-address>
567                                                                                 </excluded-v6-addresses>
568                                                                                 <v6-dhcp-pool-prefix>0:0</v6-dhcp-pool-prefix>
569                                                                         </v6-dhcp-pools>
570                                                                 </dhcp>
571                                                                 <firewall-lite>
572                                                                         <stateful-firewall-lite-v6-enabled>N</stateful-firewall-lite-v6-enabled>
573                                                                         <stateful-firewall-lite-v4-enabled>Y</stateful-firewall-lite-v4-enabled>
574                                                                         <v4-firewall-packet-filters>
575                                                                           <v4-firewall-prefix>0.0.0.1</v4-firewall-prefix>
576                                                                           <v4-firewall-prefix-length>1</v4-firewall-prefix-length>
577                                                                           <allow-icmp-ping>Y</allow-icmp-ping>
578                                                                           <udp-ports>
579                                                                             <port-number>1</port-number>
580                                                                           </udp-ports>
581                                                                           <tcp-ports>
582                                                                             <port-number>1</port-number>
583                                                                           </tcp-ports>
584                                                                         </v4-firewall-packet-filters>
585                                                                         <v4-firewall-packet-filters>
586                                                                           <v4-firewall-prefix>0.0.0.2</v4-firewall-prefix>
587                                                                           <v4-firewall-prefix-length>2</v4-firewall-prefix-length>
588                                                                           <allow-icmp-ping>Y</allow-icmp-ping>
589                                                                           <udp-ports>
590                                                                             <port-number>2</port-number>
591                                                                           </udp-ports>
592                                                                           <tcp-ports>
593                                                                             <port-number>2</port-number>
594                                                                           </tcp-ports>
595                                                                         </v4-firewall-packet-filters>
596                                                                         <v6-firewall-packet-filters>
597                                                                           <v6-firewall-prefix>:</v6-firewall-prefix>
598                                                                           <v6-firewall-prefix-length>0</v6-firewall-prefix-length>
599                                                                           <allow-icmp-ping>Y</allow-icmp-ping>
600                                                                           <udp-ports>
601                                                                             <port-number>3</port-number>
602                                                                           </udp-ports>
603                                                                           <tcp-ports>
604                                                                             <port-number>3</port-number>
605                                                                           </tcp-ports>
606                                                                         </v6-firewall-packet-filters>
607                                                                         <v6-firewall-packet-filters>
608                                                                           <v6-firewall-prefix>:</v6-firewall-prefix>
609                                                                           <v6-firewall-prefix-length>1</v6-firewall-prefix-length>
610                                                                           <allow-icmp-ping>Y</allow-icmp-ping>
611                                                                           <udp-ports>
612                                                                             <port-number>4</port-number>
613                                                                           </udp-ports>
614                                                                           <tcp-ports>
615                                                                             <port-number>4</port-number>
616                                                                           </tcp-ports>
617                                                                         </v6-firewall-packet-filters>
618                                                                 </firewall-lite>
619                                                                 <pat>
620                                                                         <v4-pat-pools>
621                                                                                 <v4-pat-pool-prefix>192.168.1.44</v4-pat-pool-prefix>
622                                                                                 <v4-pat-pool-next-hop-address>192.168.1.5</v4-pat-pool-next-hop-address>
623                                                                                 <v4-pat-pool-prefix-length>0</v4-pat-pool-prefix-length>
624                                                                         </v4-pat-pools>
625                                                                         <use-v4-default-pool>Y</use-v4-default-pool>
626                                                                         <v4-pat-enabled>N</v4-pat-enabled>
627                                                                         <v4-pat-pools>
628                                                                                 <v4-pat-pool-prefix>192.168.1.45</v4-pat-pool-prefix>
629                                                                                 <v4-pat-pool-next-hop-address>192.168.1.6</v4-pat-pool-next-hop-address>
630                                                                                 <v4-pat-pool-prefix-length>28</v4-pat-pool-prefix-length>
631                                                                         </v4-pat-pools>
632                                                                 </pat>
633                                                                 <nat>
634                                                                   <v4-nat-enabled>Y</v4-nat-enabled>
635                                                                   <v4-nat-mapping-entries>
636                                                                     <v4-nat-internal>0.0.0.0</v4-nat-internal>
637                                                                     <v4-nat-next-hop-address>0.0.0.0</v4-nat-next-hop-address>
638                                                                     <v4-nat-external>0.0.0.0</v4-nat-external>
639                                                                   </v4-nat-mapping-entries>
640                                                                   <v4-nat-mapping-entries>
641                                                                     <v4-nat-internal>0.0.0.1</v4-nat-internal>
642                                                                     <v4-nat-next-hop-address>0.0.0.1</v4-nat-next-hop-address>
643                                                                     <v4-nat-external>0.0.0.1</v4-nat-external>
644                                                                   </v4-nat-mapping-entries>
645                                                                 </nat>
646                                                                 <vr-designation>primary</vr-designation>
647                                                                 <v4-vce-loopback-address>162.200.3.144</v4-vce-loopback-address>
648                                                                 <v6-vr-lan-prefix-length>64</v6-vr-lan-prefix-length>
649                                                                 <v6-vce-wan-address>2001:1890:12e3:2da::</v6-vce-wan-address>
650                                                                 <v6-vr-lan-prefix>2620:0:10d0:f:ffff:ffff:ffff:fffe</v6-vr-lan-prefix>
651                                                                 <v4-vr-lan-prefix-length>24</v4-vr-lan-prefix-length>
652                                                                 <v4-vr-lan-prefix>10.192.27.254</v4-vr-lan-prefix>
653                                                                 <v4-public-lan-prefixes>
654                                                                         <t-provided-v4-lan-public-prefixes>
655                                                                                 <request-index>1</request-index>
656                                                                                 <v4-next-hop-address>192.168.1.2</v4-next-hop-address>
657                                                                                 <v4-lan-public-prefix>192.168.1.1</v4-lan-public-prefix>
658                                                                                 <v4-lan-public-prefix-length>28</v4-lan-public-prefix-length>
659                                                                         </t-provided-v4-lan-public-prefixes>
660                                                                         <t-provided-v4-lan-public-prefixes>
661                                                                                 <request-index>1</request-index>
662                                                                                 <v4-next-hop-address>192.168.1.72</v4-next-hop-address>
663                                                                                 <v4-lan-public-prefix>192.168.1.71</v4-lan-public-prefix>
664                                                                                 <v4-lan-public-prefix-length>28</v4-lan-public-prefix-length>
665                                                                         </t-provided-v4-lan-public-prefixes>
666                                                                         <t-provided-v4-lan-public-prefixes>
667                                                                                 <request-index>1</request-index>
668                                                                                 <v4-next-hop-address>192.168.1.68</v4-next-hop-address>
669                                                                                 <v4-lan-public-prefix>192.168.1.67</v4-lan-public-prefix>
670                                                                                 <v4-lan-public-prefix-length>28</v4-lan-public-prefix-length>
671                                                                         </t-provided-v4-lan-public-prefixes>
672                                                                 </v4-public-lan-prefixes>
673                                                                 <v6-public-lan-prefixes>
674                                                                         <t-provided-v6-lan-public-prefixes>
675                                                                                 <request-index>1</request-index>
676                                                                                 <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
677                                                                                 <v6-lan-public-prefix>2001:1890:12e3:2da::</v6-lan-public-prefix>
678                                                                                 <v6-lan-public-prefix-length>28</v6-lan-public-prefix-length>
679                                                                         </t-provided-v6-lan-public-prefixes>
680                                                                         <t-provided-v6-lan-public-prefixes>
681                                                                                 <request-index>1</request-index>
682                                                                                 <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
683                                                                                 <v6-lan-public-prefix>2001:1890:12e3:3da::</v6-lan-public-prefix>
684                                                                                 <v6-lan-public-prefix-length>28</v6-lan-public-prefix-length>
685                                                                         </t-provided-v6-lan-public-prefixes>
686                                                                         <t-provided-v6-lan-public-prefixes>
687                                                                                 <request-index>1</request-index>
688                                                                                 <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
689                                                                                 <v6-lan-public-prefix>2001:1890:12e3:4da::</v6-lan-public-prefix>
690                                                                                 <v6-lan-public-prefix-length>28</v6-lan-public-prefix-length>
691                                                                         </t-provided-v6-lan-public-prefixes>
692                                                                 </v6-public-lan-prefixes>
693                                                         </vr-lan-interface>
694                                                         <routing-protocol>none</routing-protocol>
695                                                 </vr-lan>
696 <ucpe-vms-service-information>
697  <transport-service-information>
698     <transport-service-type>AVPN</transport-service-type>
699         <access-circuit-info>
700            <access-circuit-id>1</access-circuit-id>
701            <dual-mode>Active</dual-mode>
702         </access-circuit-info>
703         <access-circuit-info>
704            <access-circuit-id>2</access-circuit-id>
705            <dual-mode>Standby</dual-mode>
706         </access-circuit-info>
707  </transport-service-information>
708  <ucpe-information>
709     <ucpe-host-name>hostname</ucpe-host-name>
710     <ucpe-activation-code>activecode</ucpe-activation-code>
711     <out-of-band-management-modem>OOB</out-of-band-management-modem>
712   </ucpe-information>
713   <vnf-list>
714         <vnf-information>
715                 <vnf-instance-id>1</vnf-instance-id>
716                 <vnf-sequence-number>1</vnf-sequence-number>
717                 <vnf-type>ZZ</vnf-type>
718                 <vnf-vendor>JUNIPER</vnf-vendor>
719                 <vnf-model>MODEL1</vnf-model>
720                 <vnf-id>1</vnf-id>
721                 <prov-status>1</prov-status>
722                 <operational-state>1</operational-state>
723                 <orchestration-status>1</orchestration-status>
724                 <equipment-role>1</equipment-role>
725     </vnf-information>
726         <vnf-information>
727                 <vnf-instance-id>2</vnf-instance-id>
728                 <vnf-sequence-number>2</vnf-sequence-number>
729                 <vnf-type>HY</vnf-type>
730                 <vnf-vendor>JUNIPER</vnf-vendor>
731                 <vnf-model>MODEL2</vnf-model>
732                 <vnf-id>2</vnf-id>
733                 <prov-status>2</prov-status>
734                 <operational-state>2</operational-state>
735                 <orchestration-status>2</orchestration-status>
736                 <equipment-role>2</equipment-role>
737     </vnf-information>
738   </vnf-list>
739  </ucpe-vms-service-information>
740                                                 <request-information>
741                                                         <request-action>Layer3ServiceActivateRequest</request-action>
742                                                         <order-number>4281555</order-number>
743                                                         <request-id>155415ab-b4a7-4382-b4c6-d17d9sm42855</request-id>
744                                                         <notification-url>https://csi-tst-q22.it.com:22443/Services/com/cingular/csi/sdn/SendManagedNetworkStatusNotification.jws</notification-url>
745                                                         <source>OMX</source>
746                                                         <order-version>1</order-version>
747                                                 </request-information>
748                                                 <sdnc-request-header>
749                                                         <svc-action>activate</svc-action>
750                                                         <svc-notification-url>https://localhost:8443/adapters/rest/SDNCNotify</svc-notification-url>
751                                                         <svc-request-id>5b1f3c5d-cdf9-488d-8a4b-d3f1229d7760</svc-request-id>
752                                                 </sdnc-request-header>
753                                                 <l2-homing-information>
754                                                         <topology>MultiPoint</topology>
755                                                         <preferred-aic-clli>MTSNJA4LCP1</preferred-aic-clli>
756                                                         <evc-name>AS/VLXM/003717//SW</evc-name>
757                                                 </l2-homing-information>
758                                                 <service-information>
759                                                         <service-instance-id>FK/VLXM/003717//SW_INTERNET</service-instance-id>
760                                                         <subscriber-name>ST E2E Test42855_1300004281555</subscriber-name>
761                                                         <service-type>SDN-ETHERNET-INTERNET</service-type>
762                                                 </service-information>
763                                                 <internet-service-change-details>
764                                                         <internet-evc-speed-value>10</internet-evc-speed-value>
765                                                         <internet-evc-speed-units>Kbps</internet-evc-speed-units>
766                                                         <t-provided-v4-lan-public-prefixes>
767                                                            <request-index>1</request-index>
768                                                            <v4-next-hop-address>192.168.1.15</v4-next-hop-address>
769                                                            <v4-lan-public-prefix>192.168.1.15</v4-lan-public-prefix>
770                                                            <v4-lan-public-prefix-length>28</v4-lan-public-prefix-length>
771                                                         </t-provided-v4-lan-public-prefixes>
772                                                         <t-provided-v4-lan-public-prefixes>
773                                                            <request-index>2</request-index>
774                                                            <v4-next-hop-address>192.168.1.16</v4-next-hop-address>
775                                                            <v4-lan-public-prefix>192.168.1.16</v4-lan-public-prefix>
776                                                            <v4-lan-public-prefix-length>28</v4-lan-public-prefix-length>
777                                                         </t-provided-v4-lan-public-prefixes>
778                                                         <t-provided-v6-lan-public-prefixes>
779                                                            <request-index>1</request-index>
780                                                            <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
781                                                            <v6-lan-public-prefix>2001:1890:12e3:2da::</v6-lan-public-prefix>
782                                                            <v6-lan-public-prefix-length>28</v6-lan-public-prefix-length>
783                                                         </t-provided-v6-lan-public-prefixes>
784                                                         <t-provided-v6-lan-public-prefixes>
785                                                            <request-index>1</request-index>
786                                                            <v6-next-hop-address>2001:1890:12e3:2da::</v6-next-hop-address>
787                                                            <v6-lan-public-prefix>2001:1890:12e3:2da::</v6-lan-public-prefix>
788                                                            <v6-lan-public-prefix-length>28</v6-lan-public-prefix-length>
789                                                         </t-provided-v6-lan-public-prefixes>
790                                                 </internet-service-change-details>
791                                         </service-data>
792                                 </layer3-service-list>
793 </tag0:RequestData>
794 """
795
796 def sdncAdapterResponseEmpty =
797 """<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1">
798    <sdncadapterworkflow:response-data/>
799 </sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
800
801 def sdncAdapterResponseError =
802 """<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1"
803                                                  xmlns:tag0="http://org.onap/workflow/sdnc/adapter/schema/v1">
804    <sdncadapterworkflow:response-data>
805       <tag0:CallbackHeader>
806          <tag0:RequestId>39542e39-ccc3-4d1a-8b79-04ce88526613</tag0:RequestId>
807          <tag0:ResponseCode>404</tag0:ResponseCode>
808          <tag0:ResponseMessage>Error processing request to SDNC. Not Found.
809                         https://localhost:8443/restconf/config/L3SDN-API:services/layer3-service-list/MVM%2FVLXP%2F000855%2F%2FShakeout.
810                         SDNC Returned-[error-type:application, error-tag:data-missing,
811                         error-message:Request could not be completed because the relevant
812                         data model content does not exist.]</tag0:ResponseMessage>
813       </tag0:CallbackHeader>
814    </sdncadapterworkflow:response-data>
815 </sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
816
817
818         @Test
819         public void testPreProcessRequest() {
820
821                 String sdncAdapterWorkflowRequest = FileUtil.readResourceFile("__files/SDN-ETHERNET-INTERNET/SDNCAdapterV1/sdncadapterworkflowrequest.xml");
822                 ExecutionEntity mockExecution = mock(ExecutionEntity.class)
823                 when(mockExecution.getVariable("mso.adapters.po.auth")).thenReturn("5E12ACACBD552A415E081E29F2C4772F9835792A51C766CCFDD7433DB5220B59969CB2798C")
824                 when(mockExecution.getVariable("mso.msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7")
825                 when(mockExecution.getVariable("mso-request-id")).thenReturn("testReqId")
826                 when(mockExecution.getVariable("sdncAdapterWorkflowRequest")).thenReturn(sdncAdapterWorkflowRequest)
827                 when(mockExecution.getVariable("mso.workflow.sdncadapter.callback")).thenReturn("http://someurl.someting.com:28080/mso/sdncAdapterCallbackServiceImpl")
828                 when(mockExecution.getVariable("mso.use.qualified.host")).thenReturn("true")
829
830                 when(mockExecution.getProcessInstanceId()).thenReturn("745b1b50-e39e-4685-9cc8-c71f0bde8bf0")
831                 when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
832
833
834                 SDNCAdapter sdncAdapter = new SDNCAdapter()
835                 sdncAdapter.preProcessRequest(mockExecution)
836
837                 MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
838                 debugger.printInvocations(mockExecution)
839
840
841                 verify(mockExecution).setVariable("prefix","SDNCA_")
842                 verify(mockExecution).setVariable("sdncAdapterResponse","")
843                 verify(mockExecution).setVariable("asynchronousResponseTimeout",false)
844                 verify(mockExecution).setVariable("continueListening",false)
845                 verify(mockExecution).setVariable("serviceConfigActivate",false)
846                 verify(mockExecution).setVariable("SDNCA_SuccessIndicator",false)
847                 verify(mockExecution).setVariable("SDNCA_InterimNotify",false)
848                 verify(mockExecution).setVariable("BasicAuthHeaderValue","Basic dGVzdDp0ZXN0")
849                 verify(mockExecution).setVariable("source","")
850                 verify(mockExecution).setVariable("SDNCA_requestId", "745b1b50-e39e-4685-9cc8-c71f0bde8bf0")
851                 verify(mockExecution).setVariable("sdncAdapterRequest", sdncAdapterRequest)
852         }
853
854         @Test
855         public void testProcessResponse()
856         {
857                 String sdncAdapterCallbackResponse = FileUtil.readResourceFile("__files/SDN-ETHERNET-INTERNET/SDNCAdapterV1mock/sdncadaptercallbackrequest.xml");
858                 ExecutionEntity mockExecution = mock(ExecutionEntity.class)
859                 when(mockExecution.getVariable("sdncAdapterCallbackRequest")).thenReturn(sdncAdapterCallbackResponse)
860                 SDNCAdapter sdncAdapter = new SDNCAdapter()
861                 sdncAdapter.postProcessResponse(mockExecution)
862
863 //              MockitoDebuggerImpl debugger = new MockitoDebuggerImpl()
864 //              debugger.printInvocations(mockExecution)
865
866                 verify(mockExecution,times(2)).getVariable("sdncAdapterCallbackRequest")
867         //      verify(mockExecution).setVariable("enhancedCallbackRequestData",enhancedCallbackRequestData)
868                 verify(mockExecution).setVariable("sdncAdapterResponse",workflowResponse)
869                 verify(mockExecution).setVariable("continueListening",false)
870
871         }
872
873         @Test
874         public void testProcessResponse_ErrorCase_404()
875         {
876                 String sdncAdapterCallbackErrorResponse = FileUtil.readResourceFile("sdncadaptercallbackrequest_404CallBack.xml");
877                 ExecutionEntity mockExecution = mock(ExecutionEntity.class)
878                 when(mockExecution.getVariable("sdncAdapterCallbackRequest")).thenReturn(sdncAdapterCallbackErrorResponse)
879                 SDNCAdapter sdncAdapter = new SDNCAdapter()
880                 sdncAdapter.postProcessResponse(mockExecution)
881
882                 verify(mockExecution,times(2)).getVariable("sdncAdapterCallbackRequest")
883                 verify(mockExecution).setVariable("sdncAdapterResponse", sdncAdapterResponseError)
884                 verify(mockExecution).setVariable("enhancedCallbackRequestData", "")
885                 verify(mockExecution).setVariable("continueListening",false)
886
887         }
888
889         @Test
890         public void testProcessResponse_ErrorCase_InvalidCallback()
891         {
892                 ExecutionEntity mockExecution = mock(ExecutionEntity.class)
893                 when(mockExecution.getVariable("sdncAdapterCallbackRequest")).thenReturn("<h1>Service Unavailable</h1>")
894                 SDNCAdapter sdncAdapter = new SDNCAdapter()
895                 sdncAdapter.postProcessResponse(mockExecution)
896
897                 verify(mockExecution,times(2)).getVariable("sdncAdapterCallbackRequest")
898                 verify(mockExecution).setVariable("sdncAdapterResponse", sdncAdapterResponseEmpty)
899                 verify(mockExecution).setVariable("enhancedCallbackRequestData", "")
900                 verify(mockExecution).setVariable("continueListening",false)
901
902         }
903
904         @Test
905         public void postProcessResponse()
906         {
907
908                 String SDNCAdapterCallbackRequest =
909                 """<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
910 <SDNCAdapterCallbackRequest
911         xmlns="http://org.onap/workflow/sdnc/adapter/schema/v1">
912         <CallbackHeader>
913                 <RequestId>3bb02798-b344-4d28-9bca-1f029954d1c9</RequestId>
914                 <ResponseCode>404</ResponseCode>
915                 <ResponseMessage>Error processing request to SDNC. Not Found.
916                         https://localhost:8443/restconf/config/L3SDN-API:services/layer3-service-list/85%2FCSIP%2F141203%2FPT_CSI9999998693.
917                         SDNC Returned-[error-type:application, error-tag:data-missing,
918                         error-message:Request could not be completed because the relevant
919                         data model content does not exist ]</ResponseMessage>
920         </CallbackHeader>
921 </SDNCAdapterCallbackRequest>"""
922
923                 String sdncAdapterResponse =
924                 """<sdncadapterworkflow:SDNCAdapterWorkflowResponse xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1"
925                                                  xmlns:tag0="http://org.onap/workflow/sdnc/adapter/schema/v1">
926    <sdncadapterworkflow:response-data>
927       <tag0:CallbackHeader>
928          <tag0:RequestId>3bb02798-b344-4d28-9bca-1f029954d1c9</tag0:RequestId>
929          <tag0:ResponseCode>404</tag0:ResponseCode>
930          <tag0:ResponseMessage>Error processing request to SDNC. Not Found.
931                         https://localhost:8443/restconf/config/L3SDN-API:services/layer3-service-list/85%2FCSIP%2F141203%2FPT_CSI9999998693.
932                         SDNC Returned-[error-type:application, error-tag:data-missing,
933                         error-message:Request could not be completed because the relevant
934                         data model content does not exist ]</tag0:ResponseMessage>
935       </tag0:CallbackHeader>
936    </sdncadapterworkflow:response-data>
937 </sdncadapterworkflow:SDNCAdapterWorkflowResponse>"""
938
939                 ExecutionEntity mockExecution = mock(ExecutionEntity.class)
940                 when(mockExecution.getVariable("sdncAdapterCallbackRequest")).thenReturn(SDNCAdapterCallbackRequest)
941                 SDNCAdapter sdncAdapter = new SDNCAdapter()
942                 sdncAdapter.postProcessResponse(mockExecution)
943
944                 verify(mockExecution,times(2)).getVariable("sdncAdapterCallbackRequest")
945                 verify(mockExecution).setVariable("sdncAdapterResponse", sdncAdapterResponse)
946                 verify(mockExecution).setVariable("enhancedCallbackRequestData", "")
947                 verify(mockExecution).setVariable("continueListening",false)
948
949         }
950
951 }