Merge "Extract getSupplementaryFile out of VFM controller"
[vid.git] / vid-webpack-master / src / app / shared / components / genericFormPopup / generic-form-popup.service.spec.ts
1 import {getTestBed, TestBed} from '@angular/core/testing';
2 import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing';
3 import {FormBuilder, FormGroup} from '@angular/forms';
4 import {GenericFormPopupService} from "./generic-form-popup.service";
5 import {IframeService} from "../../utils/iframe.service";
6 import {NgRedux} from "@angular-redux/store";
7 import {ServicePopupService} from "./genericFormServices/service/service.popup.service";
8 import {BasicControlGenerator} from "../genericForm/formControlsServices/basic.control.generator";
9 import {AaiService} from "../../services/aaiService/aai.service";
10 import {ServiceControlGenerator} from "../genericForm/formControlsServices/service.control.generator";
11 import {GenericFormService} from "../genericForm/generic-form.service";
12 import {LogService} from "../../utils/log/log.service";
13 import {DefaultDataGeneratorService} from "../../services/defaultDataServiceGenerator/default.data.generator.service";
14 import {BasicPopupService} from "./genericFormServices/basic.popup.service";
15 import {ActivatedRoute} from "@angular/router";
16 import {UUIDData} from "./generic-form-popup.component";
17 import {ITreeNode} from "angular-tree-component/dist/defs/api";
18 import {NetworkPopupService} from "./genericFormServices/network/network.popup.service";
19 import {NetworkControlGenerator} from "../genericForm/formControlsServices/networkGenerator/network.control.generator";
20 import {VfModulePopuopService} from "./genericFormServices/vfModule/vfModule.popuop.service";
21 import {VfModuleControlGenerator} from "../genericForm/formControlsServices/vfModuleGenerator/vfModule.control.generator";
22 import {FeatureFlagsService} from "../../services/featureFlag/feature-flags.service";
23 import {VfModuleUpgradePopupService} from "./genericFormServices/vfModuleUpgrade/vfModule.upgrade.popuop.service";
24
25 class MockAppStore<T>{
26   getState() {
27     return {
28       "global": {
29         "name": null,
30         "flags": {
31           "FLAG_NETWORK_TO_ASYNC_INSTANTIATION": false,
32           "FLAG_SHOW_ASSIGNMENTS": true,
33           "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true,
34           "FLAG_SHOW_VERIFY_SERVICE": false,
35           "FLAG_SERVICE_MODEL_CACHE": true,
36           "FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD": false,
37           "FLAG_ADD_MSO_TESTAPI_FIELD": true
38         },
39         "type": "[FLAGS] Update"
40       },
41       "service": {
42         "serviceHierarchy": {
43           "6e59c5de-f052-46fa-aa7e-2fca9d674c44": {
44             "service": {
45               "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
46               "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
47               "name": "ComplexService",
48               "version": "1.0",
49               "toscaModelURL": null,
50               "category": "Emanuel",
51               "serviceType": "",
52               "serviceRole": "",
53               "description": "ComplexService",
54               "serviceEcompNaming": "false",
55               "instantiationType": "Macro",
56               "vidNotions": {
57                 "instantiationType": "Macro"
58               },
59               "inputs": {}
60             },
61             "vnfs": {
62               "VF_vGeraldine 0": {
63                 "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60",
64                 "invariantUuid": "4160458e-f648-4b30-a176-43881ffffe9e",
65                 "description": "VSP_vGeraldine",
66                 "name": "VF_vGeraldine",
67                 "version": "2.0",
68                 "customizationUuid": "91415b44-753d-494c-926a-456a9172bbb9",
69                 "inputs": {},
70                 "commands": {},
71                 "serviceEcompNaming" : "true",
72                 "properties": {
73                   "ecomp_generated_naming": "false",
74                   "max_instances": 10,
75                   "min_instances": 1,
76                   "gpb2_Internal2_mac": "00:11:22:EF:AC:DF",
77                   "sctp-b-ipv6-egress_src_start_port": "0",
78                   "sctp-a-ipv6-egress_rule_application": "any",
79                   "Internal2_allow_transit": "true",
80                   "sctp-b-IPv6_ethertype": "IPv6",
81                   "sctp-a-egress_rule_application": "any",
82                   "sctp-b-ingress_action": "pass",
83                   "sctp-b-ingress_rule_protocol": "icmp",
84                   "ncb2_Internal1_mac": "00:11:22:EF:AC:DF",
85                   "sctp-b-ipv6-ingress-src_start_port": "0.0",
86                   "ncb1_Internal2_mac": "00:11:22:EF:AC:DF",
87                   "fsb_volume_size_0": "320.0",
88                   "sctp-b-egress_src_addresses": "local",
89                   "sctp-a-ipv6-ingress_ethertype": "IPv4",
90                   "sctp-a-ipv6-ingress-dst_start_port": "0",
91                   "sctp-b-ipv6-ingress_rule_application": "any",
92                   "domain_name": "default-domain",
93                   "sctp-a-ingress_rule_protocol": "icmp",
94                   "sctp-b-egress-src_start_port": "0.0",
95                   "sctp-a-egress_src_addresses": "local",
96                   "sctp-b-display_name": "epc-sctp-b-ipv4v6-sec-group",
97                   "sctp-a-egress-src_start_port": "0.0",
98                   "sctp-a-ingress_ethertype": "IPv4",
99                   "sctp-b-ipv6-ingress-dst_end_port": "65535",
100                   "sctp-b-dst_subnet_prefix_v6": "::",
101                   "nf_naming": "{ecomp_generated_naming=true}",
102                   "sctp-a-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
103                   "sctp-b-egress-dst_start_port": "0.0",
104                   "ncb_flavor_name": "nv.c20r64d1",
105                   "gpb1_Internal1_mac": "00:11:22:EF:AC:DF",
106                   "sctp-b-egress_dst_subnet_prefix_len": "0.0",
107                   "Internal2_net_cidr": "10.0.0.10",
108                   "sctp-a-ingress-dst_start_port": "0.0",
109                   "sctp-a-egress-dst_start_port": "0.0",
110                   "fsb1_Internal2_mac": "00:11:22:EF:AC:DF",
111                   "sctp-a-egress_ethertype": "IPv4",
112                   "vlc_st_service_mode": "in-network-nat",
113                   "sctp-a-ipv6-egress_ethertype": "IPv4",
114                   "sctp-a-egress-src_end_port": "65535.0",
115                   "sctp-b-ipv6-egress_rule_application": "any",
116                   "sctp-b-egress_action": "pass",
117                   "sctp-a-ingress-src_subnet_prefix_len": "0.0",
118                   "sctp-b-ipv6-ingress-src_end_port": "65535.0",
119                   "sctp-b-name": "epc-sctp-b-ipv4v6-sec-group",
120                   "fsb2_Internal1_mac": "00:11:22:EF:AC:DF",
121                   "sctp-a-ipv6-ingress-src_start_port": "0.0",
122                   "sctp-b-ipv6-egress_ethertype": "IPv4",
123                   "Internal1_net_cidr": "10.0.0.10",
124                   "sctp-a-egress_dst_subnet_prefix": "0.0.0.0",
125                   "fsb_flavor_name": "nv.c20r64d1",
126                   "sctp_rule_protocol": "132",
127                   "sctp-b-ipv6-ingress_src_subnet_prefix_len": "0",
128                   "sctp-a-ipv6-ingress_rule_application": "any",
129                   "sctp-a-IPv6_ethertype": "IPv6",
130                   "vlc2_Internal1_mac": "00:11:22:EF:AC:DF",
131                   "vlc_st_virtualization_type": "virtual-machine",
132                   "sctp-b-ingress-dst_start_port": "0.0",
133                   "sctp-b-ingress-dst_end_port": "65535.0",
134                   "sctp-a-ipv6-ingress-src_end_port": "65535.0",
135                   "sctp-a-display_name": "epc-sctp-a-ipv4v6-sec-group",
136                   "sctp-b-ingress_rule_application": "any",
137                   "int2_sec_group_name": "int2-sec-group",
138                   "vlc_flavor_name": "nd.c16r64d1",
139                   "sctp-b-ipv6-egress_src_addresses": "local",
140                   "vlc_st_interface_type_int1": "other1",
141                   "sctp-b-egress-src_end_port": "65535.0",
142                   "sctp-a-ipv6-egress-dst_start_port": "0",
143                   "vlc_st_interface_type_int2": "other2",
144                   "sctp-a-ipv6-egress_rule_protocol": "any",
145                   "Internal2_shared": "false",
146                   "sctp-a-ipv6-egress_dst_subnet_prefix_len": "0",
147                   "Internal2_rpf": "disable",
148                   "vlc1_Internal1_mac": "00:11:22:EF:AC:DF",
149                   "sctp-b-ipv6-egress_src_end_port": "65535",
150                   "sctp-a-ipv6-egress_src_addresses": "local",
151                   "sctp-a-ingress-dst_end_port": "65535.0",
152                   "sctp-a-ipv6-egress_src_end_port": "65535",
153                   "Internal1_forwarding_mode": "l2",
154                   "Internal2_dhcp": "false",
155                   "sctp-a-dst_subnet_prefix_v6": "::",
156                   "pxe_image_name": "MME_PXE-Boot_16ACP04_GA.qcow2",
157                   "vlc_st_interface_type_gtp": "other0",
158                   "ncb1_Internal1_mac": "00:11:22:EF:AC:DF",
159                   "sctp-b-src_subnet_prefix_v6": "::",
160                   "sctp-a-egress_dst_subnet_prefix_len": "0.0",
161                   "int1_sec_group_name": "int1-sec-group",
162                   "Internal1_dhcp": "false",
163                   "sctp-a-ipv6-egress_dst_end_port": "65535",
164                   "Internal2_forwarding_mode": "l2",
165                   "fsb2_Internal2_mac": "00:11:22:EF:AC:DF",
166                   "sctp-b-egress_dst_subnet_prefix": "0.0.0.0",
167                   "Internal1_net_cidr_len": "17",
168                   "gpb2_Internal1_mac": "00:11:22:EF:AC:DF",
169                   "sctp-b-ingress-src_subnet_prefix_len": "0.0",
170                   "sctp-a-ingress_dst_addresses": "local",
171                   "sctp-a-egress_action": "pass",
172                   "fsb_volume_type_0": "SF-Default-SSD",
173                   "ncb2_Internal2_mac": "00:11:22:EF:AC:DF",
174                   "vlc_st_interface_type_sctp_a": "left",
175                   "vlc_st_interface_type_sctp_b": "right",
176                   "sctp-a-src_subnet_prefix_v6": "::",
177                   "vlc_st_version": "2",
178                   "sctp-b-egress_ethertype": "IPv4",
179                   "sctp-a-ingress_rule_application": "any",
180                   "gpb1_Internal2_mac": "00:11:22:EF:AC:DF",
181                   "instance_ip_family_v6": "v6",
182                   "sctp-a-ipv6-egress_src_start_port": "0",
183                   "sctp-b-ingress-src_start_port": "0.0",
184                   "sctp-b-ingress_dst_addresses": "local",
185                   "fsb1_Internal1_mac": "00:11:22:EF:AC:DF",
186                   "vlc_st_interface_type_oam": "management",
187                   "multi_stage_design": "true",
188                   "oam_sec_group_name": "oam-sec-group",
189                   "Internal2_net_gateway": "10.0.0.10",
190                   "sctp-a-ipv6-ingress-dst_end_port": "65535",
191                   "sctp-b-ipv6-egress-dst_start_port": "0",
192                   "Internal1_net_gateway": "10.0.0.10",
193                   "sctp-b-ipv6-egress_rule_protocol": "any",
194                   "gtp_sec_group_name": "gtp-sec-group",
195                   "sctp-a-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
196                   "sctp-b-ipv6-egress_dst_subnet_prefix_len": "0",
197                   "sctp-a-ipv6-ingress_dst_addresses": "local",
198                   "sctp-a-egress_rule_protocol": "icmp",
199                   "sctp-b-ipv6-egress_action": "pass",
200                   "sctp-a-ipv6-egress_action": "pass",
201                   "Internal1_shared": "false",
202                   "sctp-b-ipv6-ingress_rule_protocol": "any",
203                   "Internal2_net_cidr_len": "17",
204                   "sctp-a-name": "epc-sctp-a-ipv4v6-sec-group",
205                   "sctp-a-ingress-src_end_port": "65535.0",
206                   "sctp-b-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
207                   "sctp-a-egress-dst_end_port": "65535.0",
208                   "sctp-a-ingress_action": "pass",
209                   "sctp-b-egress_rule_protocol": "icmp",
210                   "sctp-b-ipv6-ingress_action": "pass",
211                   "vlc_st_service_type": "firewall",
212                   "sctp-b-ipv6-egress_dst_end_port": "65535",
213                   "sctp-b-ipv6-ingress-dst_start_port": "0",
214                   "vlc2_Internal2_mac": "00:11:22:EF:AC:DF",
215                   "vlc_st_availability_zone": "true",
216                   "fsb_volume_image_name_1": "MME_FSB2_16ACP04_GA.qcow2",
217                   "sctp-b-ingress-src_subnet_prefix": "0.0.0.0",
218                   "sctp-a-ipv6-ingress_src_subnet_prefix_len": "0",
219                   "Internal1_allow_transit": "true",
220                   "gpb_flavor_name": "nv.c20r64d1",
221                   "availability_zone_max_count": "1",
222                   "fsb_volume_image_name_0": "MME_FSB1_16ACP04_GA.qcow2",
223                   "sctp-b-ipv6-ingress_dst_addresses": "local",
224                   "sctp-b-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
225                   "sctp-b-ipv6-ingress_ethertype": "IPv4",
226                   "vlc1_Internal2_mac": "00:11:22:EF:AC:DF",
227                   "sctp-a-ingress-src_subnet_prefix": "0.0.0.0",
228                   "sctp-a-ipv6-ingress_action": "pass",
229                   "Internal1_rpf": "disable",
230                   "sctp-b-ingress_ethertype": "IPv4",
231                   "sctp-b-egress_rule_application": "any",
232                   "sctp-b-ingress-src_end_port": "65535.0",
233                   "sctp-a-ipv6-ingress_rule_protocol": "any",
234                   "sctp-a-ingress-src_start_port": "0.0",
235                   "sctp-b-egress-dst_end_port": "65535.0"
236                 },
237                 "type": "VF",
238                 "modelCustomizationName": "VF_vGeraldine 0",
239                 "vfModules": {
240                   "vf_vgeraldine0..VfVgeraldine..vflorence_vlc..module-1": {
241                     "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
242                     "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
243                     "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
244                     "description": null,
245                     "name": "VfVgeraldine..vflorence_vlc..module-1",
246                     "version": "2",
247                     "modelCustomizationName": "VfVgeraldine..vflorence_vlc..module-1",
248                     "properties": {
249                       "minCountInstances": 0,
250                       "maxCountInstances": null,
251                       "initialCount": 0,
252                       "vfModuleLabel": "vflorence_vlc"
253                     },
254                     "inputs": {},
255                     "volumeGroupAllowed": true
256                   },
257                   "vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2": {
258                     "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
259                     "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
260                     "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
261                     "description": null,
262                     "name": "VfVgeraldine..vflorence_gpb..module-2",
263                     "version": "2",
264                     "modelCustomizationName": "VfVgeraldine..vflorence_gpb..module-2",
265                     "properties": {
266                       "minCountInstances": 0,
267                       "maxCountInstances": null,
268                       "initialCount": 0,
269                       "vfModuleLabel": "vflorence_gpb"
270                     },
271                     "inputs": {},
272                     "volumeGroupAllowed": false
273                   },
274                   "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
275                     "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
276                     "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
277                     "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
278                     "description": null,
279                     "name": "VfVgeraldine..base_vflorence..module-0",
280                     "version": "2",
281                     "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
282                     "properties": {
283                       "minCountInstances": 1,
284                       "maxCountInstances": 1,
285                       "initialCount": 1,
286                       "vfModuleLabel": "base_vflorence"
287                     },
288                     "inputs": {},
289                     "volumeGroupAllowed": true
290                   }
291                 },
292                 "volumeGroups": {
293                   "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
294                     "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
295                     "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
296                     "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
297                     "description": null,
298                     "name": "VfVgeraldine..base_vflorence..module-0",
299                     "version": "2",
300                     "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
301                     "properties": {
302                       "minCountInstances": 1,
303                       "maxCountInstances": 1,
304                       "initialCount": 1,
305                       "vfModuleLabel": "base_vflorence"
306                     },
307                     "inputs": {}
308                   }
309                 },
310                 "vfcInstanceGroups": {}
311               }
312             },
313             "networks": {
314               "ExtVL 0": {
315                 "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986",
316                 "invariantUuid": "379f816b-a7aa-422f-be30-17114ff50b7c",
317                 "description": "ECOMP generic virtual link (network) base type for all other service-level and global networks",
318                 "name": "ExtVL",
319                 "version": "37.0",
320                 "customizationUuid": "94fdd893-4a36-4d70-b16a-ec29c54c184f",
321                 "inputs": {},
322                 "commands": {},
323                 "properties": {
324                   "ecomp_generated_naming": "false",
325                   "network_assignments": "{is_external_network=false, ipv4_subnet_default_assignment={min_subnets_count=1}, ecomp_generated_network_assignment=false, ipv6_subnet_default_assignment={min_subnets_count=1}}",
326                   "exVL_naming": "{ecomp_generated_naming=true}",
327                   "network_flows": "{is_network_policy=false, is_bound_to_vpn=false}",
328                   "network_homing": "{ecomp_selected_instance_node_target=false}"
329                 },
330                 "type": "VL",
331                 "modelCustomizationName": "ExtVL 0"
332               }
333             },
334             "collectionResources": {},
335             "configurations": {
336               "Port Mirroring Configuration By Policy 0": {
337                 "uuid": "b4398538-e89d-4f13-b33d-ca323434ba50",
338                 "invariantUuid": "6ef0ca40-f366-4897-951f-abd65d25f6f7",
339                 "description": "A port mirroring configuration by policy object",
340                 "name": "Port Mirroring Configuration By Policy",
341                 "version": "27.0",
342                 "customizationUuid": "3c3b7b8d-8669-4b3b-8664-61970041fad2",
343                 "inputs": {},
344                 "commands": {},
345                 "properties": {},
346                 "type": "Configuration",
347                 "modelCustomizationName": "Port Mirroring Configuration By Policy 0",
348                 "sourceNodes": [],
349                 "collectorNodes": null,
350                 "configurationByPolicy": false
351               }
352             },
353             "serviceProxies": {},
354             "vfModules": {
355               "vf_vgeraldine0..VfVgeraldine..vflorence_vlc..module-1": {
356                 "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
357                 "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
358                 "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
359                 "description": null,
360                 "name": "VfVgeraldine..vflorence_vlc..module-1",
361                 "version": "2",
362                 "modelCustomizationName": "VfVgeraldine..vflorence_vlc..module-1",
363                 "properties": {
364                   "minCountInstances": 0,
365                   "maxCountInstances": null,
366                   "initialCount": 0,
367                   "vfModuleLabel": "vflorence_vlc"
368                 },
369                 "inputs": {},
370                 "volumeGroupAllowed": true
371               },
372               "vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2": {
373                 "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
374                 "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
375                 "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
376                 "description": null,
377                 "name": "VfVgeraldine..vflorence_gpb..module-2",
378                 "version": "2",
379                 "modelCustomizationName": "VfVgeraldine..vflorence_gpb..module-2",
380                 "properties": {
381                   "minCountInstances": 0,
382                   "maxCountInstances": null,
383                   "initialCount": 0,
384                   "vfModuleLabel": "vflorence_gpb"
385                 },
386                 "inputs": {},
387                 "volumeGroupAllowed": false
388               },
389               "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
390                 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
391                 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
392                 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
393                 "description": null,
394                 "name": "VfVgeraldine..base_vflorence..module-0",
395                 "version": "2",
396                 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
397                 "properties": {
398                   "minCountInstances": 1,
399                   "maxCountInstances": 1,
400                   "initialCount": 1,
401                   "vfModuleLabel": "base_vflorence"
402                 },
403                 "inputs": {},
404                 "volumeGroupAllowed": true
405               }
406             },
407             "volumeGroups": {
408               "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
409                 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
410                 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
411                 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
412                 "description": null,
413                 "name": "VfVgeraldine..base_vflorence..module-0",
414                 "version": "2",
415                 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
416                 "properties": {
417                   "minCountInstances": 1,
418                   "maxCountInstances": 1,
419                   "initialCount": 1,
420                   "vfModuleLabel": "base_vflorence"
421                 },
422                 "inputs": {}
423               }
424             },
425             "pnfs": {}
426           }
427         },
428         "serviceInstance": {
429           "6e59c5de-f052-46fa-aa7e-2fca9d674c44": {
430             "networks": {},
431             "vnfs": {
432               "VF_vGeraldine 0": {
433                 "rollbackOnFailure": "true",
434                 "vfModules": {
435                   "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
436                     "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo": {
437                       "isMissingData": false,
438                       "sdncPreReload": null,
439                       "modelInfo": {
440                         "modelType": "VFmodule",
441                         "modelInvariantId": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
442                         "modelVersionId": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
443                         "modelName": "VfVgeraldine..base_vflorence..module-0",
444                         "modelVersion": "2",
445                         "modelCustomizationId": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
446                         "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0"
447                       },
448                       "instanceParams": [
449                         {}
450                       ],
451                       "trackById": "wmtm6sy2uj"
452                     }
453                   }
454                 },
455                 "isMissingData": true,
456                 "originalName": "VF_vGeraldine 0",
457                 "vnfStoreKey": "VF_vGeraldine 0",
458                 "trackById": "p3wk448m5do",
459                 "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60",
460                 "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
461                 "lcpCloudRegionId": null,
462                 "tenantId": null,
463                 "lineOfBusiness": null,
464                 "platformName": null,
465                 "modelInfo": {
466                   "modelType": "VF",
467                   "modelInvariantId": "4160458e-f648-4b30-a176-43881ffffe9e",
468                   "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
469                   "modelName": "VF_vGeraldine",
470                   "modelVersion": "2.0",
471                   "modelCustomizationName": "VF_vGeraldine 0"
472                 }
473               }
474             },
475             "instanceParams": [
476               {}
477             ],
478             "validationCounter": 1,
479             "existingNames": {},
480             "existingVNFCounterMap": {
481               "d6557200-ecf2-4641-8094-5393ae3aae60": 1
482             },
483             "globalSubscriberId": "e433710f-9217-458d-a79d-1c7aff376d89",
484             "subscriptionServiceType": "TYLER SILVIA",
485             "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
486             "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
487             "lcpCloudRegionId": "hvf6",
488             "tenantId": "229bcdc6eaeb4ca59d55221141d01f8e",
489             "aicZoneId": "JAG1",
490             "projectName": "x1",
491             "rollbackOnFailure": "true",
492             "bulkSize": 1,
493             "modelInfo": {
494               "modelInvariantId": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
495               "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
496               "modelName": "ComplexService",
497               "modelVersion": "1.0",
498               "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44"
499             },
500             "isALaCarte": false,
501             "name": "ComplexService",
502             "version": "1.0",
503             "description": "ComplexService",
504             "category": "Emanuel",
505             "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
506             "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
507             "serviceType": "",
508             "serviceRole": "",
509             "isEcompGeneratedNaming": true,
510             "isMultiStepDesign": false
511           }
512         },
513         "lcpRegionsAndTenants": {
514           "lcpRegionList": [
515             {
516               "id": "AAIAIC25",
517               "name": "AAIAIC25",
518               "isPermitted": true
519             },
520             {
521               "id": "hvf6",
522               "name": "hvf6",
523               "isPermitted": true
524             }
525           ],
526           "lcpRegionsTenantsMap": {
527             "AAIAIC25": [
528               {
529                 "id": "092eb9e8e4b7412e8787dd091bc58e86",
530                 "name": "USP-SIP-IC-24335-T-01",
531                 "isPermitted": true
532               }
533             ],
534             "hvf6": [
535               {
536                 "id": "bae71557c5bb4d5aac6743a4e5f1d054",
537                 "name": "AIN Web Tool-15-D-testalexandria",
538                 "isPermitted": true
539               },
540               {
541                 "id": "d0a3e3f2964542259d155a81c41aadc3",
542                 "name": "test-hvf6-09",
543                 "isPermitted": true
544               },
545               {
546                 "id": "fa45ca53c80b492fa8be5477cd84fc2b",
547                 "name": "ro-T112",
548                 "isPermitted": true
549               },
550               {
551                 "id": "4914ab0ab3a743e58f0eefdacc1dde77",
552                 "name": "DN5242-Nov21-T1",
553                 "isPermitted": true
554               },
555               {
556                 "id": "d0a3e3f2964542259d155a81c41aadc3",
557                 "name": "test-hvf6-09",
558                 "isPermitted": true
559               },
560               {
561                 "id": "cbb99fe4ada84631b7baf046b6fd2044",
562                 "name": "DN5242-Nov16-T3",
563                 "isPermitted": true
564               }
565             ]
566           }
567         },
568         "productFamilies": [
569           {
570             "id": "ebc3bc3d-62fd-4a3f-a037-f619df4ff034",
571             "name": "ERICA",
572             "isPermitted": true
573           },
574           {
575             "id": "17cc1042-527b-11e6-beb8-9e71128cae77",
576             "name": "IGNACIO",
577             "isPermitted": true
578           },
579           {
580             "id": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
581             "name": "Christie",
582             "isPermitted": true
583           },
584           {
585             "id": "a4f6f2ae-9bf5-4ed7-b904-06b2099c4bd7",
586             "name": "Enhanced Services",
587             "isPermitted": true
588           },
589           {
590             "id": "vTerrance",
591             "name": "vTerrance",
592             "isPermitted": true
593           },
594           {
595             "id": "323d69d9-2efe-4r45-ay0a-89ea7ard4e6f",
596             "name": "vEsmeralda",
597             "isPermitted": true
598           },
599           {
600             "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
601             "name": "Emanuel",
602             "isPermitted": true
603           },
604           {
605             "id": "d8a6ed93-251c-47ca-adc9-86671fd19f4c",
606             "name": "BVOIP",
607             "isPermitted": true
608           },
609           {
610             "id": "db171b8f-115c-4992-a2e3-ee04cae357e0",
611             "name": "LINDSEY",
612             "isPermitted": true
613           },
614           {
615             "id": "LRSI-OSPF",
616             "name": "LRSI-OSPF",
617             "isPermitted": true
618           },
619           {
620             "id": "vRosemarie",
621             "name": "HNGATEWAY",
622             "isPermitted": true
623           },
624           {
625             "id": "vHNPaas",
626             "name": "WILKINS",
627             "isPermitted": true
628           },
629           {
630             "id": "e433710f-9217-458d-a79d-1c7aff376d89",
631             "name": "TYLER SILVIA",
632             "isPermitted": true
633           },
634           {
635             "id": "b6a3f28c-eebf-494c-a900-055cc7c874ce",
636             "name": "VROUTER",
637             "isPermitted": true
638           },
639           {
640             "id": "vMuriel",
641             "name": "vMuriel",
642             "isPermitted": true
643           },
644           {
645             "id": "0ee8c1bc-7cbd-4b0a-a1ac-e9999255abc1",
646             "name": "CARA Griffin",
647             "isPermitted": true
648           },
649           {
650             "id": "c7611ebe-c324-48f1-8085-94aef0c6ef3d",
651             "name": "DARREN MCGEE",
652             "isPermitted": true
653           },
654           {
655             "id": "e30755dc-5673-4b6b-9dcf-9abdd96b93d1",
656             "name": "Transport",
657             "isPermitted": true
658           },
659           {
660             "id": "vSalvatore",
661             "name": "vSalvatore",
662             "isPermitted": true
663           },
664           {
665             "id": "d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4",
666             "name": "JOSEFINA",
667             "isPermitted": true
668           },
669           {
670             "id": "vHubbard",
671             "name": "vHubbard",
672             "isPermitted": true
673           },
674           {
675             "id": "12a96a9d-4b4c-4349-a950-fe1159602621",
676             "name": "DARREN MCGEE",
677             "isPermitted": true
678           }
679         ],
680         "serviceTypes": {
681           "e433710f-9217-458d-a79d-1c7aff376d89": [
682             {
683               "id": "0",
684               "name": "vRichardson",
685               "isPermitted": false
686             },
687             {
688               "id": "1",
689               "name": "TYLER SILVIA",
690               "isPermitted": true
691             },
692             {
693               "id": "2",
694               "name": "Emanuel",
695               "isPermitted": false
696             },
697             {
698               "id": "3",
699               "name": "vJamie",
700               "isPermitted": false
701             },
702             {
703               "id": "4",
704               "name": "vVoiceMail",
705               "isPermitted": false
706             },
707             {
708               "id": "5",
709               "name": "Kennedy",
710               "isPermitted": false
711             },
712             {
713               "id": "6",
714               "name": "vPorfirio",
715               "isPermitted": false
716             },
717             {
718               "id": "7",
719               "name": "vVM",
720               "isPermitted": false
721             },
722             {
723               "id": "8",
724               "name": "vOTA",
725               "isPermitted": false
726             },
727             {
728               "id": "9",
729               "name": "vFLORENCE",
730               "isPermitted": false
731             },
732             {
733               "id": "10",
734               "name": "vMNS",
735               "isPermitted": false
736             },
737             {
738               "id": "11",
739               "name": "vEsmeralda",
740               "isPermitted": false
741             },
742             {
743               "id": "12",
744               "name": "VPMS",
745               "isPermitted": false
746             },
747             {
748               "id": "13",
749               "name": "vWINIFRED",
750               "isPermitted": false
751             },
752             {
753               "id": "14",
754               "name": "SSD",
755               "isPermitted": false
756             },
757             {
758               "id": "15",
759               "name": "vMOG",
760               "isPermitted": false
761             },
762             {
763               "id": "16",
764               "name": "LINDSEY",
765               "isPermitted": false
766             },
767             {
768               "id": "17",
769               "name": "JOHANNA_SANTOS",
770               "isPermitted": false
771             },
772             {
773               "id": "18",
774               "name": "vCarroll",
775               "isPermitted": false
776             }
777           ]
778         },
779         "aicZones": [
780           {
781             "id": "NFT1",
782             "name": "NFTJSSSS-NFT1"
783           },
784           {
785             "id": "JAG1",
786             "name": "YUDFJULP-JAG1"
787           },
788           {
789             "id": "YYY1",
790             "name": "UUUAIAAI-YYY1"
791           },
792           {
793             "id": "AVT1",
794             "name": "AVTRFLHD-AVT1"
795           },
796           {
797             "id": "ATL34",
798             "name": "ATLSANAI-ATL34"
799           }
800         ],
801         "categoryParameters": {
802           "owningEntityList": [
803             {
804               "id": "aaa1",
805               "name": "aaa1"
806             },
807             {
808               "id": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
809               "name": "WayneHolland"
810             },
811             {
812               "id": "Melissa",
813               "name": "Melissa"
814             }
815           ],
816           "projectList": [
817             {
818               "id": "WATKINS",
819               "name": "WATKINS"
820             },
821             {
822               "id": "x1",
823               "name": "x1"
824             },
825             {
826               "id": "yyy1",
827               "name": "yyy1"
828             }
829           ],
830           "lineOfBusinessList": [
831             {
832               "id": "ONAP",
833               "name": "ONAP"
834             },
835             {
836               "id": "zzz1",
837               "name": "zzz1"
838             }
839           ],
840           "platformList": [
841             {
842               "id": "platform",
843               "name": "platform"
844             },
845             {
846               "id": "xxx1",
847               "name": "xxx1"
848             }
849           ]
850         },
851         "type": "[LCP_REGIONS_AND_TENANTS] Update",
852         "subscribers": [
853           {
854             "id": "CAR_2020_ER",
855             "name": "CAR_2020_ER",
856             "isPermitted": true
857           },
858           {
859             "id": "21014aa2-526b-11e6-beb8-9e71128cae77",
860             "name": "JULIO ERICKSON",
861             "isPermitted": false
862           },
863           {
864             "id": "DHV1707-TestSubscriber-2",
865             "name": "DALE BRIDGES",
866             "isPermitted": false
867           },
868           {
869             "id": "DHV1707-TestSubscriber-1",
870             "name": "LLOYD BRIDGES",
871             "isPermitted": false
872           },
873           {
874             "id": "jimmy-example",
875             "name": "JimmyExampleCust-20161102",
876             "isPermitted": false
877           },
878           {
879             "id": "jimmy-example2",
880             "name": "JimmyExampleCust-20161103",
881             "isPermitted": false
882           },
883           {
884             "id": "ERICA5779-TestSub-PWT-102",
885             "name": "ERICA5779-TestSub-PWT-102",
886             "isPermitted": false
887           },
888           {
889             "id": "ERICA5779-TestSub-PWT-101",
890             "name": "ERICA5779-TestSub-PWT-101",
891             "isPermitted": false
892           },
893           {
894             "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
895             "name": "Emanuel",
896             "isPermitted": false
897           },
898           {
899             "id": "ERICA5779-Subscriber-4",
900             "name": "ERICA5779-Subscriber-5",
901             "isPermitted": false
902           },
903           {
904             "id": "ERICA5779-TestSub-PWT-103",
905             "name": "ERICA5779-TestSub-PWT-103",
906             "isPermitted": false
907           },
908           {
909             "id": "ERICA5779-Subscriber-2",
910             "name": "ERICA5779-Subscriber-2",
911             "isPermitted": false
912           },
913           {
914             "id": "e433710f-9217-458d-a79d-1c7aff376d89",
915             "name": "SILVIA ROBBINS",
916             "isPermitted": true
917           },
918           {
919             "id": "ERICA5779-Subscriber-3",
920             "name": "ERICA5779-Subscriber-3",
921             "isPermitted": false
922           },
923           {
924             "id": "31739f3e-526b-11e6-beb8-9e71128cae77",
925             "name": "CRAIG/ROBERTS",
926             "isPermitted": false
927           }
928         ]
929       }
930     }
931   }
932 }
933 class ActivatedRouteMock<T>{
934   queryParams() {
935     return {
936       serviceModelId : '6e59c5de-f052-46fa-aa7e-2fca9d674c44'
937     }
938   }
939 }
940
941 class MockFeatureFlagsService {}
942
943 describe('Generic Form popup Service', () => {
944   let injector;
945   let service: GenericFormPopupService;
946   let httpMock: HttpTestingController;
947   let form : FormGroup;
948   let fb : FormBuilder;
949   let netwokPopupService : NetworkPopupService;
950   let vfModulePopupService : VfModulePopuopService;
951   let servicePopupService : ServicePopupService;
952   let _aaiService : AaiService;
953   let _activatedRoute : ActivatedRoute;
954
955   beforeAll(done => (async () => {
956     TestBed.configureTestingModule({
957       imports: [HttpClientTestingModule],
958       providers: [GenericFormPopupService,
959         FormBuilder,
960         IframeService,
961         ServicePopupService,
962         BasicControlGenerator,
963         ServiceControlGenerator,
964         GenericFormService,
965         LogService,
966         DefaultDataGeneratorService,
967         BasicPopupService,
968         AaiService,
969         NetworkPopupService,
970         NetworkControlGenerator,
971         VfModulePopuopService,
972         VfModuleUpgradePopupService,
973         VfModuleControlGenerator,
974         {provide:FeatureFlagsService, useClass: MockFeatureFlagsService},
975         {provide: ActivatedRoute, useClass: ActivatedRouteMock},
976         {provide: NgRedux, useClass: MockAppStore}]
977     });
978     await TestBed.compileComponents();
979
980     injector = getTestBed();
981     service = injector.get(GenericFormPopupService);
982     httpMock = injector.get(HttpTestingController);
983     fb = injector.get(FormBuilder);
984     netwokPopupService = injector.get(NetworkPopupService);
985     vfModulePopupService = injector.get(VfModulePopuopService);
986     servicePopupService = injector.get(ServicePopupService);
987     _aaiService = injector.get(AaiService);
988     _activatedRoute = injector.get(ActivatedRoute);
989
990   })().then(done).catch(done.fail));
991
992
993   test('VL: getGenericFormDetails should return FormPopupDetails', () => {
994     let uuidData : UUIDData = <any>{
995       type : 'VL',
996       serviceId : '6e59c5de-f052-46fa-aa7e-2fca9d674c44',
997       networkId : 'ExtVL 0',
998       networkStoreKey : 'ExtVL 0',
999       popupService : netwokPopupService
1000     };
1001     let node : ITreeNode = <any>{data : {} };
1002
1003     jest.spyOn(uuidData.popupService ,'getGenericFormPopupDetails');
1004     service.getGenericFormDetails(uuidData, node,true);
1005
1006     expect(uuidData.popupService.getGenericFormPopupDetails).toHaveBeenCalledTimes(1);
1007     expect(uuidData.popupService.getGenericFormPopupDetails).toHaveBeenCalledWith(uuidData['serviceId'],
1008       uuidData['networkId'],
1009       uuidData['networkStoreKey'],
1010       node,
1011       uuidData,
1012       true
1013     );
1014   });
1015
1016   test('VFmodule: getGenericFormDetails should return FormPopupDetails', () => {
1017     let uuidData : UUIDData = <any>{
1018       type : 'VFmodule',
1019       serviceId : '6e59c5de-f052-46fa-aa7e-2fca9d674c44',
1020       vnfStoreKey : 'VF_vGeraldine 0',
1021       vFModuleStoreKey : 'vf_vgeraldine0..VfVgeraldine..vflorence_vlc..module-1',
1022       popupService : vfModulePopupService
1023     };
1024     let node : ITreeNode = <any>{data : {}};
1025
1026     spyOn(uuidData.popupService ,'getGenericFormPopupDetails');
1027     service.getGenericFormDetails(uuidData, node,true);
1028
1029     expect(uuidData.popupService.getGenericFormPopupDetails).toHaveBeenCalledTimes(1)
1030     expect(uuidData.popupService.getGenericFormPopupDetails).toHaveBeenCalledWith(
1031       uuidData['serviceId'],
1032       uuidData['vnfStoreKey'],
1033       uuidData['vFModuleStoreKey'],
1034       node,
1035       uuidData,
1036       true
1037     );
1038   });
1039
1040
1041   test('service: getGenericFormDetails should return FormPopupDetails', () => {
1042     let uuidData : UUIDData = <any>{
1043       type : 'service',
1044       serviceId : '6e59c5de-f052-46fa-aa7e-2fca9d674c44',
1045       popupService : servicePopupService
1046     };
1047     let node : ITreeNode = <any>{data : {}};
1048
1049     jest.spyOn(uuidData.popupService ,'getGenericFormPopupDetails');
1050     service.getGenericFormDetails(uuidData, node,true);
1051
1052     expect(uuidData.popupService.getGenericFormPopupDetails).toHaveBeenCalledTimes(1);
1053     expect(uuidData.popupService.getGenericFormPopupDetails).toHaveBeenCalledWith(
1054       uuidData['serviceId'],
1055       null,
1056       null,
1057       node,
1058       uuidData,
1059       true
1060     );
1061   });
1062
1063
1064   test('initReduxOnCreateNewService',() => {
1065     jest.spyOn(_aaiService, 'getServiceModelById');
1066     service.initReduxOnCreateNewService();
1067   })
1068 });