1 import {getTestBed, TestBed} from '@angular/core/testing';
2 import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing';
3 import {NgRedux} from '@angular-redux/store';
4 import {ControlGeneratorUtil, SDN_C_PRE_LOAD} from "../control.generator.util.service";
5 import {AaiService} from "../../../../services/aaiService/aai.service";
6 import {GenericFormService} from "../../generic-form.service";
7 import {FormBuilder} from "@angular/forms";
8 import {LogService} from "../../../../utils/log/log.service";
13 } from "../../../../models/formControlModels/formControl.model";
14 import {FormControlNames, VfModuleControlGenerator} from "./vfModule.control.generator";
15 import {FeatureFlagsService} from "../../../../services/featureFlag/feature-flags.service";
16 import {VfModuleInstance} from "../../../../models/vfModuleInstance";
17 import {VfModule} from "../../../../models/vfModule";
18 import {SharedControllersService} from "../sharedControlles/shared.controllers.service";
19 import {SharedTreeService} from "../../../../../drawingBoard/service-planning/objectsToTree/shared.tree.service";
21 class MockAppStore<T> {
27 "FLAG_NETWORK_TO_ASYNC_INSTANTIATION": false,
28 "FLAG_SHOW_ASSIGNMENTS": true,
29 "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true,
30 "FLAG_SHOW_VERIFY_SERVICE": false,
31 "FLAG_SERVICE_MODEL_CACHE": true,
32 "FLAG_ADD_MSO_TESTAPI_FIELD": true
34 "type": "[FLAGS] Update"
38 "6e59c5de-f052-46fa-aa7e-2fca9d674c44": {
40 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
41 "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
42 "name": "ComplexService",
44 "toscaModelURL": null,
45 "category": "Emanuel",
48 "description": "ComplexService",
49 "serviceEcompNaming": "false",
50 "instantiationType": "Macro",
55 "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60",
56 "invariantUuid": "4160458e-f648-4b30-a176-43881ffffe9e",
57 "description": "VSP_vGeraldine",
58 "name": "VF_vGeraldine",
60 "customizationUuid": "91415b44-753d-494c-926a-456a9172bbb9",
63 "serviceEcompNaming" : "true",
65 "ecomp_generated_naming": "false",
68 "gpb2_Internal2_mac": "00:11:22:EF:AC:DF",
69 "sctp-b-ipv6-egress_src_start_port": "0",
70 "sctp-a-ipv6-egress_rule_application": "any",
71 "Internal2_allow_transit": "true",
72 "sctp-b-IPv6_ethertype": "IPv6",
73 "sctp-a-egress_rule_application": "any",
74 "sctp-b-ingress_action": "pass",
75 "sctp-b-ingress_rule_protocol": "icmp",
76 "ncb2_Internal1_mac": "00:11:22:EF:AC:DF",
77 "sctp-b-ipv6-ingress-src_start_port": "0.0",
78 "ncb1_Internal2_mac": "00:11:22:EF:AC:DF",
79 "fsb_volume_size_0": "320.0",
80 "sctp-b-egress_src_addresses": "local",
81 "sctp-a-ipv6-ingress_ethertype": "IPv4",
82 "sctp-a-ipv6-ingress-dst_start_port": "0",
83 "sctp-b-ipv6-ingress_rule_application": "any",
84 "domain_name": "default-domain",
85 "sctp-a-ingress_rule_protocol": "icmp",
86 "sctp-b-egress-src_start_port": "0.0",
87 "sctp-a-egress_src_addresses": "local",
88 "sctp-b-display_name": "epc-sctp-b-ipv4v6-sec-group",
89 "sctp-a-egress-src_start_port": "0.0",
90 "sctp-a-ingress_ethertype": "IPv4",
91 "sctp-b-ipv6-ingress-dst_end_port": "65535",
92 "sctp-b-dst_subnet_prefix_v6": "::",
93 "nf_naming": "{ecomp_generated_naming=true}",
94 "sctp-a-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
95 "sctp-b-egress-dst_start_port": "0.0",
96 "ncb_flavor_name": "nv.c20r64d1",
97 "gpb1_Internal1_mac": "00:11:22:EF:AC:DF",
98 "sctp-b-egress_dst_subnet_prefix_len": "0.0",
99 "Internal2_net_cidr": "10.0.0.10",
100 "sctp-a-ingress-dst_start_port": "0.0",
101 "sctp-a-egress-dst_start_port": "0.0",
102 "fsb1_Internal2_mac": "00:11:22:EF:AC:DF",
103 "sctp-a-egress_ethertype": "IPv4",
104 "vlc_st_service_mode": "in-network-nat",
105 "sctp-a-ipv6-egress_ethertype": "IPv4",
106 "sctp-a-egress-src_end_port": "65535.0",
107 "sctp-b-ipv6-egress_rule_application": "any",
108 "sctp-b-egress_action": "pass",
109 "sctp-a-ingress-src_subnet_prefix_len": "0.0",
110 "sctp-b-ipv6-ingress-src_end_port": "65535.0",
111 "sctp-b-name": "epc-sctp-b-ipv4v6-sec-group",
112 "fsb2_Internal1_mac": "00:11:22:EF:AC:DF",
113 "sctp-a-ipv6-ingress-src_start_port": "0.0",
114 "sctp-b-ipv6-egress_ethertype": "IPv4",
115 "Internal1_net_cidr": "10.0.0.10",
116 "sctp-a-egress_dst_subnet_prefix": "0.0.0.0",
117 "fsb_flavor_name": "nv.c20r64d1",
118 "sctp_rule_protocol": "132",
119 "sctp-b-ipv6-ingress_src_subnet_prefix_len": "0",
120 "sctp-a-ipv6-ingress_rule_application": "any",
121 "sctp-a-IPv6_ethertype": "IPv6",
122 "vlc2_Internal1_mac": "00:11:22:EF:AC:DF",
123 "vlc_st_virtualization_type": "virtual-machine",
124 "sctp-b-ingress-dst_start_port": "0.0",
125 "sctp-b-ingress-dst_end_port": "65535.0",
126 "sctp-a-ipv6-ingress-src_end_port": "65535.0",
127 "sctp-a-display_name": "epc-sctp-a-ipv4v6-sec-group",
128 "sctp-b-ingress_rule_application": "any",
129 "int2_sec_group_name": "int2-sec-group",
130 "vlc_flavor_name": "nd.c16r64d1",
131 "sctp-b-ipv6-egress_src_addresses": "local",
132 "vlc_st_interface_type_int1": "other1",
133 "sctp-b-egress-src_end_port": "65535.0",
134 "sctp-a-ipv6-egress-dst_start_port": "0",
135 "vlc_st_interface_type_int2": "other2",
136 "sctp-a-ipv6-egress_rule_protocol": "any",
137 "Internal2_shared": "false",
138 "sctp-a-ipv6-egress_dst_subnet_prefix_len": "0",
139 "Internal2_rpf": "disable",
140 "vlc1_Internal1_mac": "00:11:22:EF:AC:DF",
141 "sctp-b-ipv6-egress_src_end_port": "65535",
142 "sctp-a-ipv6-egress_src_addresses": "local",
143 "sctp-a-ingress-dst_end_port": "65535.0",
144 "sctp-a-ipv6-egress_src_end_port": "65535",
145 "Internal1_forwarding_mode": "l2",
146 "Internal2_dhcp": "false",
147 "sctp-a-dst_subnet_prefix_v6": "::",
148 "pxe_image_name": "MME_PXE-Boot_16ACP04_GA.qcow2",
149 "vlc_st_interface_type_gtp": "other0",
150 "ncb1_Internal1_mac": "00:11:22:EF:AC:DF",
151 "sctp-b-src_subnet_prefix_v6": "::",
152 "sctp-a-egress_dst_subnet_prefix_len": "0.0",
153 "int1_sec_group_name": "int1-sec-group",
154 "Internal1_dhcp": "false",
155 "sctp-a-ipv6-egress_dst_end_port": "65535",
156 "Internal2_forwarding_mode": "l2",
157 "fsb2_Internal2_mac": "00:11:22:EF:AC:DF",
158 "sctp-b-egress_dst_subnet_prefix": "0.0.0.0",
159 "Internal1_net_cidr_len": "17",
160 "gpb2_Internal1_mac": "00:11:22:EF:AC:DF",
161 "sctp-b-ingress-src_subnet_prefix_len": "0.0",
162 "sctp-a-ingress_dst_addresses": "local",
163 "sctp-a-egress_action": "pass",
164 "fsb_volume_type_0": "SF-Default-SSD",
165 "ncb2_Internal2_mac": "00:11:22:EF:AC:DF",
166 "vlc_st_interface_type_sctp_a": "left",
167 "vlc_st_interface_type_sctp_b": "right",
168 "sctp-a-src_subnet_prefix_v6": "::",
169 "vlc_st_version": "2",
170 "sctp-b-egress_ethertype": "IPv4",
171 "sctp-a-ingress_rule_application": "any",
172 "gpb1_Internal2_mac": "00:11:22:EF:AC:DF",
173 "instance_ip_family_v6": "v6",
174 "sctp-a-ipv6-egress_src_start_port": "0",
175 "sctp-b-ingress-src_start_port": "0.0",
176 "sctp-b-ingress_dst_addresses": "local",
177 "fsb1_Internal1_mac": "00:11:22:EF:AC:DF",
178 "vlc_st_interface_type_oam": "management",
179 "multi_stage_design": "true",
180 "oam_sec_group_name": "oam-sec-group",
181 "Internal2_net_gateway": "10.0.0.10",
182 "sctp-a-ipv6-ingress-dst_end_port": "65535",
183 "sctp-b-ipv6-egress-dst_start_port": "0",
184 "Internal1_net_gateway": "10.0.0.10",
185 "sctp-b-ipv6-egress_rule_protocol": "any",
186 "gtp_sec_group_name": "gtp-sec-group",
187 "sctp-a-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
188 "sctp-b-ipv6-egress_dst_subnet_prefix_len": "0",
189 "sctp-a-ipv6-ingress_dst_addresses": "local",
190 "sctp-a-egress_rule_protocol": "icmp",
191 "sctp-b-ipv6-egress_action": "pass",
192 "sctp-a-ipv6-egress_action": "pass",
193 "Internal1_shared": "false",
194 "sctp-b-ipv6-ingress_rule_protocol": "any",
195 "Internal2_net_cidr_len": "17",
196 "sctp-a-name": "epc-sctp-a-ipv4v6-sec-group",
197 "sctp-a-ingress-src_end_port": "65535.0",
198 "sctp-b-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
199 "sctp-a-egress-dst_end_port": "65535.0",
200 "sctp-a-ingress_action": "pass",
201 "sctp-b-egress_rule_protocol": "icmp",
202 "sctp-b-ipv6-ingress_action": "pass",
203 "vlc_st_service_type": "firewall",
204 "sctp-b-ipv6-egress_dst_end_port": "65535",
205 "sctp-b-ipv6-ingress-dst_start_port": "0",
206 "vlc2_Internal2_mac": "00:11:22:EF:AC:DF",
207 "vlc_st_availability_zone": "true",
208 "fsb_volume_image_name_1": "MME_FSB2_16ACP04_GA.qcow2",
209 "sctp-b-ingress-src_subnet_prefix": "0.0.0.0",
210 "sctp-a-ipv6-ingress_src_subnet_prefix_len": "0",
211 "Internal1_allow_transit": "true",
212 "gpb_flavor_name": "nv.c20r64d1",
213 "availability_zone_max_count": "1",
214 "fsb_volume_image_name_0": "MME_FSB1_16ACP04_GA.qcow2",
215 "sctp-b-ipv6-ingress_dst_addresses": "local",
216 "sctp-b-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
217 "sctp-b-ipv6-ingress_ethertype": "IPv4",
218 "vlc1_Internal2_mac": "00:11:22:EF:AC:DF",
219 "sctp-a-ingress-src_subnet_prefix": "0.0.0.0",
220 "sctp-a-ipv6-ingress_action": "pass",
221 "Internal1_rpf": "disable",
222 "sctp-b-ingress_ethertype": "IPv4",
223 "sctp-b-egress_rule_application": "any",
224 "sctp-b-ingress-src_end_port": "65535.0",
225 "sctp-a-ipv6-ingress_rule_protocol": "any",
226 "sctp-a-ingress-src_start_port": "0.0",
227 "sctp-b-egress-dst_end_port": "65535.0"
230 "modelCustomizationName": "VF_vGeraldine 0",
232 "vf_vgeraldine0..VfVgeraldine..vflorence_vlc..module-1": {
233 "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
234 "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
235 "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
237 "name": "VfVgeraldine..vflorence_vlc..module-1",
239 "modelCustomizationName": "VfVgeraldine..vflorence_vlc..module-1",
241 "minCountInstances": 0,
242 "maxCountInstances": null,
244 "vfModuleLabel": "vflorence_vlc"
247 "volumeGroupAllowed": true
249 "vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2": {
250 "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
251 "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
252 "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
254 "name": "VfVgeraldine..vflorence_gpb..module-2",
256 "modelCustomizationName": "VfVgeraldine..vflorence_gpb..module-2",
258 "minCountInstances": 0,
259 "maxCountInstances": null,
261 "vfModuleLabel": "vflorence_gpb"
264 "volumeGroupAllowed": false
266 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
267 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
268 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
269 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
271 "name": "VfVgeraldine..base_vflorence..module-0",
273 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
275 "minCountInstances": 1,
276 "maxCountInstances": 1,
278 "vfModuleLabel": "base_vflorence"
281 "volumeGroupAllowed": true
285 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
286 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
287 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
288 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
290 "name": "VfVgeraldine..base_vflorence..module-0",
292 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
294 "minCountInstances": 1,
295 "maxCountInstances": 1,
297 "vfModuleLabel": "base_vflorence"
302 "vfcInstanceGroups": {}
307 "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986",
308 "invariantUuid": "379f816b-a7aa-422f-be30-17114ff50b7c",
309 "description": "ECOMP generic virtual link (network) base type for all other service-level and global networks",
312 "customizationUuid": "94fdd893-4a36-4d70-b16a-ec29c54c184f",
316 "ecomp_generated_naming": "false",
317 "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}}",
318 "exVL_naming": "{ecomp_generated_naming=true}",
319 "network_flows": "{is_network_policy=false, is_bound_to_vpn=false}",
320 "network_homing": "{ecomp_selected_instance_node_target=false}"
323 "modelCustomizationName": "ExtVL 0"
326 "collectionResources": {},
328 "Port Mirroring Configuration By Policy 0": {
329 "uuid": "b4398538-e89d-4f13-b33d-ca323434ba50",
330 "invariantUuid": "6ef0ca40-f366-4897-951f-abd65d25f6f7",
331 "description": "A port mirroring configuration by policy object",
332 "name": "Port Mirroring Configuration By Policy",
334 "customizationUuid": "3c3b7b8d-8669-4b3b-8664-61970041fad2",
338 "type": "Configuration",
339 "modelCustomizationName": "Port Mirroring Configuration By Policy 0",
341 "collectorNodes": null,
342 "configurationByPolicy": false
345 "serviceProxies": {},
347 "vf_vgeraldine0..VfVgeraldine..vflorence_vlc..module-1": {
348 "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
349 "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
350 "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
352 "name": "VfVgeraldine..vflorence_vlc..module-1",
354 "modelCustomizationName": "VfVgeraldine..vflorence_vlc..module-1",
356 "minCountInstances": 0,
357 "maxCountInstances": null,
359 "vfModuleLabel": "vflorence_vlc"
362 "volumeGroupAllowed": true
364 "vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2": {
365 "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
366 "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
367 "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
369 "name": "VfVgeraldine..vflorence_gpb..module-2",
371 "modelCustomizationName": "VfVgeraldine..vflorence_gpb..module-2",
373 "minCountInstances": 0,
374 "maxCountInstances": null,
376 "vfModuleLabel": "vflorence_gpb"
379 "volumeGroupAllowed": false
381 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
382 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
383 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
384 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
386 "name": "VfVgeraldine..base_vflorence..module-0",
388 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
390 "minCountInstances": 1,
391 "maxCountInstances": 1,
393 "vfModuleLabel": "base_vflorence"
396 "volumeGroupAllowed": true
400 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
401 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
402 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
403 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
405 "name": "VfVgeraldine..base_vflorence..module-0",
407 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
409 "minCountInstances": 1,
410 "maxCountInstances": 1,
412 "vfModuleLabel": "base_vflorence"
421 "6e59c5de-f052-46fa-aa7e-2fca9d674c44": {
425 "rollbackOnFailure": "true",
427 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
428 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo": {
429 "isMissingData": false,
430 "sdncPreReload": null,
432 "modelType": "VFmodule",
433 "modelInvariantId": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
434 "modelVersionId": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
435 "modelName": "VfVgeraldine..base_vflorence..module-0",
437 "modelCustomizationId": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
438 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0"
443 "trackById": "wmtm6sy2uj"
447 "isMissingData": true,
448 "originalName": "VF_vGeraldine 0",
449 "vnfStoreKey": "VF_vGeraldine 0",
450 "trackById": "p3wk448m5do",
451 "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60",
452 "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
453 "lcpCloudRegionId": null,
455 "lineOfBusiness": null,
456 "platformName": null,
459 "modelInvariantId": "4160458e-f648-4b30-a176-43881ffffe9e",
460 "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
461 "modelName": "VF_vGeraldine",
462 "modelVersion": "2.0",
463 "modelCustomizationName": "VF_vGeraldine 0"
470 "validationCounter": 1,
472 "existingVNFCounterMap": {
473 "d6557200-ecf2-4641-8094-5393ae3aae60": 1
475 "globalSubscriberId": "e433710f-9217-458d-a79d-1c7aff376d89",
476 "subscriptionServiceType": "TYLER SILVIA",
477 "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
478 "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
479 "lcpCloudRegionId": "hvf6",
480 "tenantId": "229bcdc6eaeb4ca59d55221141d01f8e",
483 "rollbackOnFailure": "true",
486 "modelInvariantId": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
487 "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
488 "modelName": "ComplexService",
489 "modelVersion": "1.0",
490 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44"
493 "name": "ComplexService",
495 "description": "ComplexService",
496 "category": "Emanuel",
497 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
498 "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
501 "isEcompGeneratedNaming": true,
502 "isMultiStepDesign": false
505 "lcpRegionsAndTenants": {
518 "lcpRegionsTenantsMap": {
521 "id": "092eb9e8e4b7412e8787dd091bc58e86",
522 "name": "USP-SIP-IC-24335-T-01",
528 "id": "bae71557c5bb4d5aac6743a4e5f1d054",
529 "name": "AIN Web Tool-15-D-testalexandria",
533 "id": "d0a3e3f2964542259d155a81c41aadc3",
534 "name": "test-hvf6-09",
538 "id": "fa45ca53c80b492fa8be5477cd84fc2b",
543 "id": "cbb99fe4ada84631b7baf046b6fd2044",
544 "name": "DN5242-Nov16-T3",
552 "id": "ebc3bc3d-62fd-4a3f-a037-f619df4ff034",
557 "id": "17cc1042-527b-11e6-beb8-9e71128cae77",
562 "id": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
567 "id": "a4f6f2ae-9bf5-4ed7-b904-06b2099c4bd7",
568 "name": "Enhanced Services",
577 "id": "323d69d9-2efe-4r45-ay0a-89ea7ard4e6f",
578 "name": "vEsmeralda",
582 "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
587 "id": "d8a6ed93-251c-47ca-adc9-86671fd19f4c",
592 "id": "db171b8f-115c-4992-a2e3-ee04cae357e0",
612 "id": "e433710f-9217-458d-a79d-1c7aff376d89",
613 "name": "TYLER SILVIA",
617 "id": "b6a3f28c-eebf-494c-a900-055cc7c874ce",
627 "id": "0ee8c1bc-7cbd-4b0a-a1ac-e9999255abc1",
628 "name": "CARA Griffin",
632 "id": "c7611ebe-c324-48f1-8085-94aef0c6ef3d",
633 "name": "DARREN MCGEE",
637 "id": "e30755dc-5673-4b6b-9dcf-9abdd96b93d1",
643 "name": "vSalvatore",
647 "id": "d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4",
657 "id": "12a96a9d-4b4c-4349-a950-fe1159602621",
658 "name": "DARREN MCGEE",
663 "e433710f-9217-458d-a79d-1c7aff376d89": [
666 "name": "vRichardson",
671 "name": "TYLER SILVIA",
686 "name": "vVoiceMail",
721 "name": "vEsmeralda",
751 "name": "JOHANNA_SANTOS",
764 "name": "NFTJSSSS-NFT1"
768 "name": "YUDFJULP-JAG1"
772 "name": "UUUAIAAI-YYY1"
776 "name": "AVTRFLHD-AVT1"
780 "name": "ATLSANAI-ATL34"
783 "categoryParameters": {
784 "owningEntityList": [
790 "id": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
791 "name": "WayneHolland"
812 "lineOfBusinessList": [
833 "type": "[LCP_REGIONS_AND_TENANTS] Update",
837 "name": "CAR_2020_ER",
841 "id": "21014aa2-526b-11e6-beb8-9e71128cae77",
842 "name": "JULIO ERICKSON",
846 "id": "DHV1707-TestSubscriber-2",
847 "name": "DALE BRIDGES",
851 "id": "DHV1707-TestSubscriber-1",
852 "name": "LLOYD BRIDGES",
856 "id": "jimmy-example",
857 "name": "JimmyExampleCust-20161102",
861 "id": "jimmy-example2",
862 "name": "JimmyExampleCust-20161103",
866 "id": "ERICA5779-TestSub-PWT-102",
867 "name": "ERICA5779-TestSub-PWT-102",
871 "id": "ERICA5779-TestSub-PWT-101",
872 "name": "ERICA5779-TestSub-PWT-101",
876 "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
881 "id": "ERICA5779-Subscriber-4",
882 "name": "ERICA5779-Subscriber-5",
886 "id": "ERICA5779-TestSub-PWT-103",
887 "name": "ERICA5779-TestSub-PWT-103",
891 "id": "ERICA5779-Subscriber-2",
892 "name": "ERICA5779-Subscriber-2",
896 "id": "e433710f-9217-458d-a79d-1c7aff376d89",
897 "name": "SILVIA ROBBINS",
901 "id": "ERICA5779-Subscriber-3",
902 "name": "ERICA5779-Subscriber-3",
906 "id": "31739f3e-526b-11e6-beb8-9e71128cae77",
907 "name": "CRAIG/ROBERTS",
916 class MockFeatureFlagsService {}
918 describe('VFModule Control Generator', () => {
920 let service: VfModuleControlGenerator;
921 let httpMock: HttpTestingController;
923 beforeAll(done => (async () => {
924 TestBed.configureTestingModule({
925 imports: [HttpClientTestingModule],
926 providers: [VfModuleControlGenerator,
928 SharedControllersService,
929 ControlGeneratorUtil,
934 {provide:FeatureFlagsService, useClass: MockFeatureFlagsService},
935 {provide: NgRedux, useClass: MockAppStore}]
937 await TestBed.compileComponents();
939 injector = getTestBed();
940 service = injector.get(VfModuleControlGenerator);
941 httpMock = injector.get(HttpTestingController);
942 jest.spyOn(console, 'error');
944 })().then(done).catch(done.fail));
946 test(' getMacroFormControls gets vnfStoreKey === null', () => {
947 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
948 const vnfStoreKey: string = null;
949 const vfModuleStoreKey: string = 'vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0';
950 const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830";
951 const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vfModuleStoreKey, vfModuleUUID, true);
953 expect(controls).toEqual([]);
954 expect(console.error).toHaveBeenCalled();
957 test('getAlaCarteFormControls check for mandatory controls', () => {
958 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
959 const vnfStoreKey: string = 'VF_vGeraldine 0';
960 const vfModuleStoreKey: string = 'vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0';
961 const uuidData: Object = {
962 modelId : "522159d5-d6e0-4c2a-aa44-5a542a12a830",
963 modelName : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0",
964 serviceId : "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
966 vFModuleStoreKey : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo",
967 vnfStoreKey : "VF_vGeraldine 0"
969 const controls: FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vfModuleStoreKey, uuidData, true);
971 const mandatoryControls : string[] = [
972 FormControlNames.INSTANCE_NAME,
973 FormControlNames.LCPCLOUD_REGION_ID,
974 FormControlNames.TENANT_ID,
975 FormControlNames.ROLLBACK_ON_FAILURE,
978 for(let i = 0 ; i < mandatoryControls.length ; i++) {
979 let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required');
980 expect(requiredExist).toBeDefined();
986 [true, true, true, null, true, true],
987 [true, true, false, null, true, false], //Scenario to check that UI field doesn't appear.
988 [false, true, false, "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0_vol", true, true],
989 [false, true, true, "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0_vol", true, true],
990 [false, false, true, null, false, false],
993 test.each(cases)('Given Ecomp Gen Name: %p and VG Name %p , ' +
994 'is A La Carte %p - expect the name value for VG to be %p , ' +
995 'VG Name should be defined: %p , and should the field be visible: %p',
996 (ecomGenName, vGName, isALaCarte, expectedName, shouldWeVerifyDefinitionOfField, isVisible) => {
997 const moduleName = "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0";
998 service.vfModuleModel = new VfModule();
999 service.vfModuleModel.name = moduleName;
1000 service.vfModuleModel.volumeGroupAllowed = vGName;
1001 let vnf : Object = {isEcompGeneratedNaming: ecomGenName};
1002 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1003 const vnfStoreKey: string = 'VF_vGeraldine 0';
1004 const uuidData: Object = {
1005 modelName : moduleName,
1006 vFModuleStoreKey : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo",
1008 const vfModuleModel :VfModuleInstance = service.getVfModuleInstance(serviceId, vnfStoreKey, uuidData,true);
1009 let existingMatchingFieldInForm = buildVfModuleFormControlModel(vfModuleModel ,serviceId, vnf, isALaCarte);
1010 if (shouldWeVerifyDefinitionOfField) {
1011 expect(existingMatchingFieldInForm).toBeDefined();
1012 expect(existingMatchingFieldInForm.value).toEqual(expectedName);
1013 expect(existingMatchingFieldInForm.isVisible).toEqual(isVisible);
1015 expect(existingMatchingFieldInForm).toBeUndefined();
1019 let buildVfModuleFormControlModel = function(vfModuleModel :any, serviceId: string, vnf, isALaCarte) :FormControlModel {
1020 let controls: FormControlModel[] = service.pushInstanceAndVGToForm([], vfModuleModel, serviceId, vnf, isALaCarte);
1021 return controls.find(ctrl => ctrl.controlName === FormControlNames.VOLUME_GROUP_NAME);
1024 test('getMacroFormControls check for mandatory controls', () => {
1025 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1026 const vnfStoreKey: string = 'VF_vGeraldine 0';
1027 const uuidData: Object = {
1028 modelId : "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
1029 modelName : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0",
1030 serviceId : "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
1032 vFModuleStoreKey : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo",
1033 vnfStoreKey : "VF_vGeraldine 0"
1035 const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfStoreKey, uuidData, true);
1037 const mandatoryControls : string[] = [
1041 for(let i = 0 ; i < mandatoryControls.length ; i++) {
1042 let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required');
1043 expect(requiredExist).toBeDefined();
1047 test(' getMacroFormControls gets null vnfStoreKey', () => {
1048 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1049 const vnfStoreKey: string = null;
1050 const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830";
1051 const uuidData: Object = {};
1052 const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vfModuleUUID, uuidData,true);
1054 expect(controls).toEqual([]);
1055 expect(console.error).toHaveBeenCalled();
1058 test('getAlaCarteFormControls should return the correct order of controls', () => {
1059 const controls:FormControlModel[] = getAlaCarteFormControls();
1061 const orderedControls : string[] = [
1062 FormControlNames.INSTANCE_NAME,
1063 FormControlNames.VOLUME_GROUP_NAME,
1064 FormControlNames.LCPCLOUD_REGION_ID,
1065 FormControlNames.LEGACY_REGION,
1066 FormControlNames.TENANT_ID,
1067 FormControlNames.ROLLBACK_ON_FAILURE,
1071 expect(controls.length).toEqual(7);
1072 for(let i = 0 ; i < orderedControls.length ; i++) {
1073 expect(controls[i].controlName).toEqual(orderedControls[i]);
1077 function getAlaCarteFormControls():FormControlModel[] {
1078 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1079 const vnfStoreKey: string = 'VF_vGeraldine 0';
1080 const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830";
1081 const uuidData: Object = {
1082 modelId: "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
1083 modelName: "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0",
1084 serviceId: "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
1086 vFModuleStoreKey: "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo",
1087 vnfStoreKey: "VF_vGeraldine 0"
1089 const controls: FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vfModuleUUID, uuidData, true);
1093 test('getAlaCarteFormControls responce with wrong order of controls', () => {
1094 const controls:FormControlModel[] = getAlaCarteFormControls();
1096 const orderedControls : string[] = [
1097 FormControlNames.INSTANCE_NAME,
1098 FormControlNames.VOLUME_GROUP_NAME,
1099 FormControlNames.LCPCLOUD_REGION_ID,
1100 FormControlNames.TENANT_ID, // TENANT_ID must be after LEGACY_REGION
1101 FormControlNames.LEGACY_REGION,
1102 FormControlNames.ROLLBACK_ON_FAILURE,
1106 for(let i = 0 ; i < orderedControls.length ; i++) {
1107 if (controls[i].controlName === 'legacyRegion') {
1108 expect(orderedControls[i]).toEqual('tenantId');
1113 test('getMacroFormControls should return the correct order of controls', () => {
1114 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1115 const vnfStoreKey: string = 'VF_vGeraldine 0';
1116 const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830";
1117 const uuidData: Object = {
1118 modelId : "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
1119 modelName : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0",
1120 serviceId : "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
1122 vFModuleStoreKey : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo",
1123 vnfStoreKey : "VF_vGeraldine 0"
1125 const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vfModuleUUID, uuidData, true);
1127 const orderedControls : string[] = [
1128 FormControlNames.INSTANCE_NAME,
1129 FormControlNames.VOLUME_GROUP_NAME
1132 for(let i = 0 ; i < orderedControls.length ; i++) {
1133 expect(controls[i].controlName).toEqual(orderedControls[i]);
1140 ${'volumeGroupName'}
1141 `('getAlacartFormControls $controllerName control validator shall have the expected regex', ({controllerName}) => {
1142 const controls:FormControlModel[] = getAlaCarteFormControls();
1144 const instanceNameControl: FormControlModel = <FormControlModel>controls.find(item => item.controlName == controllerName);
1145 const instanceNameValidator: ValidatorModel = instanceNameControl.validations.find(val => val.validatorName === ValidatorOptions.pattern);
1146 expect(instanceNameValidator.validatorArg).toEqual(/^[a-zA-Z0-9._-]*$/);
1149 test(' getAlaCarteFormControls gets null service', () => {
1150 const controls:FormControlModel[] = getAlaCarteFormControls();
1151 expect(controls.length).toEqual(7);
1153 const orderedControls : string[] = [
1154 FormControlNames.INSTANCE_NAME,
1155 FormControlNames.VOLUME_GROUP_NAME,
1156 FormControlNames.LCPCLOUD_REGION_ID,
1157 FormControlNames.LEGACY_REGION,
1158 FormControlNames.TENANT_ID,
1159 FormControlNames.ROLLBACK_ON_FAILURE,
1163 for(let i = 0 ; i < orderedControls.length ; i++) {
1164 expect(controls[i].controlName).toEqual(orderedControls[i]);