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";
9 import {FormControlModel, ValidatorModel, ValidatorOptions} from "../../../../models/formControlModels/formControl.model";
10 import {FormControlNames, VfModuleControlGenerator} from "./vfModule.control.generator";
11 import {FeatureFlagsService} from "../../../../services/featureFlag/feature-flags.service";
12 import {VfModuleInstance} from "../../../../models/vfModuleInstance";
13 import {VfModule} from "../../../../models/vfModule";
14 import {SharedControllersService} from "../sharedControlles/shared.controllers.service";
16 class MockAppStore<T> {
22 "FLAG_NETWORK_TO_ASYNC_INSTANTIATION": false,
23 "FLAG_SHOW_ASSIGNMENTS": true,
24 "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true,
25 "FLAG_SHOW_VERIFY_SERVICE": false,
26 "FLAG_SERVICE_MODEL_CACHE": true,
27 "FLAG_ADD_MSO_TESTAPI_FIELD": true
29 "type": "[FLAGS] Update"
33 "6e59c5de-f052-46fa-aa7e-2fca9d674c44": {
35 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
36 "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
37 "name": "ComplexService",
39 "toscaModelURL": null,
40 "category": "Emanuel",
43 "description": "ComplexService",
44 "serviceEcompNaming": "false",
45 "instantiationType": "Macro",
50 "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60",
51 "invariantUuid": "4160458e-f648-4b30-a176-43881ffffe9e",
52 "description": "VSP_vGeraldine",
53 "name": "VF_vGeraldine",
55 "customizationUuid": "91415b44-753d-494c-926a-456a9172bbb9",
58 "serviceEcompNaming" : "true",
60 "ecomp_generated_naming": "false",
63 "gpb2_Internal2_mac": "00:11:22:EF:AC:DF",
64 "sctp-b-ipv6-egress_src_start_port": "0",
65 "sctp-a-ipv6-egress_rule_application": "any",
66 "Internal2_allow_transit": "true",
67 "sctp-b-IPv6_ethertype": "IPv6",
68 "sctp-a-egress_rule_application": "any",
69 "sctp-b-ingress_action": "pass",
70 "sctp-b-ingress_rule_protocol": "icmp",
71 "ncb2_Internal1_mac": "00:11:22:EF:AC:DF",
72 "sctp-b-ipv6-ingress-src_start_port": "0.0",
73 "ncb1_Internal2_mac": "00:11:22:EF:AC:DF",
74 "fsb_volume_size_0": "320.0",
75 "sctp-b-egress_src_addresses": "local",
76 "sctp-a-ipv6-ingress_ethertype": "IPv4",
77 "sctp-a-ipv6-ingress-dst_start_port": "0",
78 "sctp-b-ipv6-ingress_rule_application": "any",
79 "domain_name": "default-domain",
80 "sctp-a-ingress_rule_protocol": "icmp",
81 "sctp-b-egress-src_start_port": "0.0",
82 "sctp-a-egress_src_addresses": "local",
83 "sctp-b-display_name": "epc-sctp-b-ipv4v6-sec-group",
84 "sctp-a-egress-src_start_port": "0.0",
85 "sctp-a-ingress_ethertype": "IPv4",
86 "sctp-b-ipv6-ingress-dst_end_port": "65535",
87 "sctp-b-dst_subnet_prefix_v6": "::",
88 "nf_naming": "{ecomp_generated_naming=true}",
89 "sctp-a-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
90 "sctp-b-egress-dst_start_port": "0.0",
91 "ncb_flavor_name": "nv.c20r64d1",
92 "gpb1_Internal1_mac": "00:11:22:EF:AC:DF",
93 "sctp-b-egress_dst_subnet_prefix_len": "0.0",
94 "Internal2_net_cidr": "10.0.0.10",
95 "sctp-a-ingress-dst_start_port": "0.0",
96 "sctp-a-egress-dst_start_port": "0.0",
97 "fsb1_Internal2_mac": "00:11:22:EF:AC:DF",
98 "sctp-a-egress_ethertype": "IPv4",
99 "vlc_st_service_mode": "in-network-nat",
100 "sctp-a-ipv6-egress_ethertype": "IPv4",
101 "sctp-a-egress-src_end_port": "65535.0",
102 "sctp-b-ipv6-egress_rule_application": "any",
103 "sctp-b-egress_action": "pass",
104 "sctp-a-ingress-src_subnet_prefix_len": "0.0",
105 "sctp-b-ipv6-ingress-src_end_port": "65535.0",
106 "sctp-b-name": "epc-sctp-b-ipv4v6-sec-group",
107 "fsb2_Internal1_mac": "00:11:22:EF:AC:DF",
108 "sctp-a-ipv6-ingress-src_start_port": "0.0",
109 "sctp-b-ipv6-egress_ethertype": "IPv4",
110 "Internal1_net_cidr": "10.0.0.10",
111 "sctp-a-egress_dst_subnet_prefix": "0.0.0.0",
112 "fsb_flavor_name": "nv.c20r64d1",
113 "sctp_rule_protocol": "132",
114 "sctp-b-ipv6-ingress_src_subnet_prefix_len": "0",
115 "sctp-a-ipv6-ingress_rule_application": "any",
116 "sctp-a-IPv6_ethertype": "IPv6",
117 "vlc2_Internal1_mac": "00:11:22:EF:AC:DF",
118 "vlc_st_virtualization_type": "virtual-machine",
119 "sctp-b-ingress-dst_start_port": "0.0",
120 "sctp-b-ingress-dst_end_port": "65535.0",
121 "sctp-a-ipv6-ingress-src_end_port": "65535.0",
122 "sctp-a-display_name": "epc-sctp-a-ipv4v6-sec-group",
123 "sctp-b-ingress_rule_application": "any",
124 "int2_sec_group_name": "int2-sec-group",
125 "vlc_flavor_name": "nd.c16r64d1",
126 "sctp-b-ipv6-egress_src_addresses": "local",
127 "vlc_st_interface_type_int1": "other1",
128 "sctp-b-egress-src_end_port": "65535.0",
129 "sctp-a-ipv6-egress-dst_start_port": "0",
130 "vlc_st_interface_type_int2": "other2",
131 "sctp-a-ipv6-egress_rule_protocol": "any",
132 "Internal2_shared": "false",
133 "sctp-a-ipv6-egress_dst_subnet_prefix_len": "0",
134 "Internal2_rpf": "disable",
135 "vlc1_Internal1_mac": "00:11:22:EF:AC:DF",
136 "sctp-b-ipv6-egress_src_end_port": "65535",
137 "sctp-a-ipv6-egress_src_addresses": "local",
138 "sctp-a-ingress-dst_end_port": "65535.0",
139 "sctp-a-ipv6-egress_src_end_port": "65535",
140 "Internal1_forwarding_mode": "l2",
141 "Internal2_dhcp": "false",
142 "sctp-a-dst_subnet_prefix_v6": "::",
143 "pxe_image_name": "MME_PXE-Boot_16ACP04_GA.qcow2",
144 "vlc_st_interface_type_gtp": "other0",
145 "ncb1_Internal1_mac": "00:11:22:EF:AC:DF",
146 "sctp-b-src_subnet_prefix_v6": "::",
147 "sctp-a-egress_dst_subnet_prefix_len": "0.0",
148 "int1_sec_group_name": "int1-sec-group",
149 "Internal1_dhcp": "false",
150 "sctp-a-ipv6-egress_dst_end_port": "65535",
151 "Internal2_forwarding_mode": "l2",
152 "fsb2_Internal2_mac": "00:11:22:EF:AC:DF",
153 "sctp-b-egress_dst_subnet_prefix": "0.0.0.0",
154 "Internal1_net_cidr_len": "17",
155 "gpb2_Internal1_mac": "00:11:22:EF:AC:DF",
156 "sctp-b-ingress-src_subnet_prefix_len": "0.0",
157 "sctp-a-ingress_dst_addresses": "local",
158 "sctp-a-egress_action": "pass",
159 "fsb_volume_type_0": "SF-Default-SSD",
160 "ncb2_Internal2_mac": "00:11:22:EF:AC:DF",
161 "vlc_st_interface_type_sctp_a": "left",
162 "vlc_st_interface_type_sctp_b": "right",
163 "sctp-a-src_subnet_prefix_v6": "::",
164 "vlc_st_version": "2",
165 "sctp-b-egress_ethertype": "IPv4",
166 "sctp-a-ingress_rule_application": "any",
167 "gpb1_Internal2_mac": "00:11:22:EF:AC:DF",
168 "instance_ip_family_v6": "v6",
169 "sctp-a-ipv6-egress_src_start_port": "0",
170 "sctp-b-ingress-src_start_port": "0.0",
171 "sctp-b-ingress_dst_addresses": "local",
172 "fsb1_Internal1_mac": "00:11:22:EF:AC:DF",
173 "vlc_st_interface_type_oam": "management",
174 "multi_stage_design": "true",
175 "oam_sec_group_name": "oam-sec-group",
176 "Internal2_net_gateway": "10.0.0.10",
177 "sctp-a-ipv6-ingress-dst_end_port": "65535",
178 "sctp-b-ipv6-egress-dst_start_port": "0",
179 "Internal1_net_gateway": "10.0.0.10",
180 "sctp-b-ipv6-egress_rule_protocol": "any",
181 "gtp_sec_group_name": "gtp-sec-group",
182 "sctp-a-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
183 "sctp-b-ipv6-egress_dst_subnet_prefix_len": "0",
184 "sctp-a-ipv6-ingress_dst_addresses": "local",
185 "sctp-a-egress_rule_protocol": "icmp",
186 "sctp-b-ipv6-egress_action": "pass",
187 "sctp-a-ipv6-egress_action": "pass",
188 "Internal1_shared": "false",
189 "sctp-b-ipv6-ingress_rule_protocol": "any",
190 "Internal2_net_cidr_len": "17",
191 "sctp-a-name": "epc-sctp-a-ipv4v6-sec-group",
192 "sctp-a-ingress-src_end_port": "65535.0",
193 "sctp-b-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
194 "sctp-a-egress-dst_end_port": "65535.0",
195 "sctp-a-ingress_action": "pass",
196 "sctp-b-egress_rule_protocol": "icmp",
197 "sctp-b-ipv6-ingress_action": "pass",
198 "vlc_st_service_type": "firewall",
199 "sctp-b-ipv6-egress_dst_end_port": "65535",
200 "sctp-b-ipv6-ingress-dst_start_port": "0",
201 "vlc2_Internal2_mac": "00:11:22:EF:AC:DF",
202 "vlc_st_availability_zone": "true",
203 "fsb_volume_image_name_1": "MME_FSB2_16ACP04_GA.qcow2",
204 "sctp-b-ingress-src_subnet_prefix": "0.0.0.0",
205 "sctp-a-ipv6-ingress_src_subnet_prefix_len": "0",
206 "Internal1_allow_transit": "true",
207 "gpb_flavor_name": "nv.c20r64d1",
208 "availability_zone_max_count": "1",
209 "fsb_volume_image_name_0": "MME_FSB1_16ACP04_GA.qcow2",
210 "sctp-b-ipv6-ingress_dst_addresses": "local",
211 "sctp-b-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
212 "sctp-b-ipv6-ingress_ethertype": "IPv4",
213 "vlc1_Internal2_mac": "00:11:22:EF:AC:DF",
214 "sctp-a-ingress-src_subnet_prefix": "0.0.0.0",
215 "sctp-a-ipv6-ingress_action": "pass",
216 "Internal1_rpf": "disable",
217 "sctp-b-ingress_ethertype": "IPv4",
218 "sctp-b-egress_rule_application": "any",
219 "sctp-b-ingress-src_end_port": "65535.0",
220 "sctp-a-ipv6-ingress_rule_protocol": "any",
221 "sctp-a-ingress-src_start_port": "0.0",
222 "sctp-b-egress-dst_end_port": "65535.0"
225 "modelCustomizationName": "VF_vGeraldine 0",
227 "vf_vgeraldine0..VfVgeraldine..vflorence_vlc..module-1": {
228 "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
229 "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
230 "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
232 "name": "VfVgeraldine..vflorence_vlc..module-1",
234 "modelCustomizationName": "VfVgeraldine..vflorence_vlc..module-1",
236 "minCountInstances": 0,
237 "maxCountInstances": null,
239 "vfModuleLabel": "vflorence_vlc"
242 "volumeGroupAllowed": true
244 "vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2": {
245 "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
246 "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
247 "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
249 "name": "VfVgeraldine..vflorence_gpb..module-2",
251 "modelCustomizationName": "VfVgeraldine..vflorence_gpb..module-2",
253 "minCountInstances": 0,
254 "maxCountInstances": null,
256 "vfModuleLabel": "vflorence_gpb"
259 "volumeGroupAllowed": false
261 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
262 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
263 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
264 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
266 "name": "VfVgeraldine..base_vflorence..module-0",
268 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
270 "minCountInstances": 1,
271 "maxCountInstances": 1,
273 "vfModuleLabel": "base_vflorence"
276 "volumeGroupAllowed": true
280 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
281 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
282 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
283 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
285 "name": "VfVgeraldine..base_vflorence..module-0",
287 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
289 "minCountInstances": 1,
290 "maxCountInstances": 1,
292 "vfModuleLabel": "base_vflorence"
297 "vfcInstanceGroups": {}
302 "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986",
303 "invariantUuid": "379f816b-a7aa-422f-be30-17114ff50b7c",
304 "description": "ECOMP generic virtual link (network) base type for all other service-level and global networks",
307 "customizationUuid": "94fdd893-4a36-4d70-b16a-ec29c54c184f",
311 "ecomp_generated_naming": "false",
312 "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}}",
313 "exVL_naming": "{ecomp_generated_naming=true}",
314 "network_flows": "{is_network_policy=false, is_bound_to_vpn=false}",
315 "network_homing": "{ecomp_selected_instance_node_target=false}"
318 "modelCustomizationName": "ExtVL 0"
321 "collectionResources": {},
323 "Port Mirroring Configuration By Policy 0": {
324 "uuid": "b4398538-e89d-4f13-b33d-ca323434ba50",
325 "invariantUuid": "6ef0ca40-f366-4897-951f-abd65d25f6f7",
326 "description": "A port mirroring configuration by policy object",
327 "name": "Port Mirroring Configuration By Policy",
329 "customizationUuid": "3c3b7b8d-8669-4b3b-8664-61970041fad2",
333 "type": "Configuration",
334 "modelCustomizationName": "Port Mirroring Configuration By Policy 0",
336 "collectorNodes": null,
337 "configurationByPolicy": false
340 "serviceProxies": {},
342 "vf_vgeraldine0..VfVgeraldine..vflorence_vlc..module-1": {
343 "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
344 "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
345 "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
347 "name": "VfVgeraldine..vflorence_vlc..module-1",
349 "modelCustomizationName": "VfVgeraldine..vflorence_vlc..module-1",
351 "minCountInstances": 0,
352 "maxCountInstances": null,
354 "vfModuleLabel": "vflorence_vlc"
357 "volumeGroupAllowed": true
359 "vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2": {
360 "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
361 "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
362 "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
364 "name": "VfVgeraldine..vflorence_gpb..module-2",
366 "modelCustomizationName": "VfVgeraldine..vflorence_gpb..module-2",
368 "minCountInstances": 0,
369 "maxCountInstances": null,
371 "vfModuleLabel": "vflorence_gpb"
374 "volumeGroupAllowed": false
376 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
377 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
378 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
379 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
381 "name": "VfVgeraldine..base_vflorence..module-0",
383 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
385 "minCountInstances": 1,
386 "maxCountInstances": 1,
388 "vfModuleLabel": "base_vflorence"
391 "volumeGroupAllowed": true
395 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
396 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
397 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
398 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
400 "name": "VfVgeraldine..base_vflorence..module-0",
402 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
404 "minCountInstances": 1,
405 "maxCountInstances": 1,
407 "vfModuleLabel": "base_vflorence"
416 "6e59c5de-f052-46fa-aa7e-2fca9d674c44": {
420 "rollbackOnFailure": "true",
422 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
423 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo": {
424 "isMissingData": false,
425 "sdncPreReload": null,
427 "modelType": "VFmodule",
428 "modelInvariantId": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
429 "modelVersionId": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
430 "modelName": "VfVgeraldine..base_vflorence..module-0",
432 "modelCustomizationId": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
433 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0"
438 "trackById": "wmtm6sy2uj"
442 "isMissingData": true,
443 "originalName": "VF_vGeraldine 0",
444 "vnfStoreKey": "VF_vGeraldine 0",
445 "trackById": "p3wk448m5do",
446 "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60",
447 "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
448 "lcpCloudRegionId": null,
450 "lineOfBusiness": null,
451 "platformName": null,
454 "modelInvariantId": "4160458e-f648-4b30-a176-43881ffffe9e",
455 "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
456 "modelName": "VF_vGeraldine",
457 "modelVersion": "2.0",
458 "modelCustomizationName": "VF_vGeraldine 0"
465 "validationCounter": 1,
467 "existingVNFCounterMap": {
468 "d6557200-ecf2-4641-8094-5393ae3aae60": 1
470 "globalSubscriberId": "e433710f-9217-458d-a79d-1c7aff376d89",
471 "subscriptionServiceType": "TYLER SILVIA",
472 "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
473 "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
474 "lcpCloudRegionId": "hvf6",
475 "tenantId": "229bcdc6eaeb4ca59d55221141d01f8e",
478 "rollbackOnFailure": "true",
481 "modelInvariantId": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
482 "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
483 "modelName": "ComplexService",
484 "modelVersion": "1.0",
485 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44"
488 "name": "ComplexService",
490 "description": "ComplexService",
491 "category": "Emanuel",
492 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
493 "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
496 "isEcompGeneratedNaming": true,
497 "isMultiStepDesign": false
500 "lcpRegionsAndTenants": {
513 "lcpRegionsTenantsMap": {
516 "id": "092eb9e8e4b7412e8787dd091bc58e86",
517 "name": "USP-SIP-IC-24335-T-01",
523 "id": "bae71557c5bb4d5aac6743a4e5f1d054",
524 "name": "AIN Web Tool-15-D-testalexandria",
528 "id": "d0a3e3f2964542259d155a81c41aadc3",
529 "name": "test-hvf6-09",
533 "id": "fa45ca53c80b492fa8be5477cd84fc2b",
538 "id": "cbb99fe4ada84631b7baf046b6fd2044",
539 "name": "DN5242-Nov16-T3",
547 "id": "ebc3bc3d-62fd-4a3f-a037-f619df4ff034",
552 "id": "17cc1042-527b-11e6-beb8-9e71128cae77",
557 "id": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
562 "id": "a4f6f2ae-9bf5-4ed7-b904-06b2099c4bd7",
563 "name": "Enhanced Services",
572 "id": "323d69d9-2efe-4r45-ay0a-89ea7ard4e6f",
573 "name": "vEsmeralda",
577 "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
582 "id": "d8a6ed93-251c-47ca-adc9-86671fd19f4c",
587 "id": "db171b8f-115c-4992-a2e3-ee04cae357e0",
607 "id": "e433710f-9217-458d-a79d-1c7aff376d89",
608 "name": "TYLER SILVIA",
612 "id": "b6a3f28c-eebf-494c-a900-055cc7c874ce",
622 "id": "0ee8c1bc-7cbd-4b0a-a1ac-e9999255abc1",
623 "name": "CARA Griffin",
627 "id": "c7611ebe-c324-48f1-8085-94aef0c6ef3d",
628 "name": "DARREN MCGEE",
632 "id": "e30755dc-5673-4b6b-9dcf-9abdd96b93d1",
638 "name": "vSalvatore",
642 "id": "d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4",
652 "id": "12a96a9d-4b4c-4349-a950-fe1159602621",
653 "name": "DARREN MCGEE",
658 "e433710f-9217-458d-a79d-1c7aff376d89": [
661 "name": "vRichardson",
666 "name": "TYLER SILVIA",
681 "name": "vVoiceMail",
716 "name": "vEsmeralda",
746 "name": "JOHANNA_SANTOS",
759 "name": "NFTJSSSS-NFT1"
763 "name": "YUDFJULP-JAG1"
767 "name": "UUUAIAAI-YYY1"
771 "name": "AVTRFLHD-AVT1"
775 "name": "ATLSANAI-ATL34"
778 "categoryParameters": {
779 "owningEntityList": [
785 "id": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
786 "name": "WayneHolland"
807 "lineOfBusinessList": [
828 "type": "[LCP_REGIONS_AND_TENANTS] Update",
832 "name": "CAR_2020_ER",
836 "id": "21014aa2-526b-11e6-beb8-9e71128cae77",
837 "name": "JULIO ERICKSON",
841 "id": "DHV1707-TestSubscriber-2",
842 "name": "DALE BRIDGES",
846 "id": "DHV1707-TestSubscriber-1",
847 "name": "LLOYD BRIDGES",
851 "id": "jimmy-example",
852 "name": "JimmyExampleCust-20161102",
856 "id": "jimmy-example2",
857 "name": "JimmyExampleCust-20161103",
861 "id": "ERICA5779-TestSub-PWT-102",
862 "name": "ERICA5779-TestSub-PWT-102",
866 "id": "ERICA5779-TestSub-PWT-101",
867 "name": "ERICA5779-TestSub-PWT-101",
871 "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
876 "id": "ERICA5779-Subscriber-4",
877 "name": "ERICA5779-Subscriber-5",
881 "id": "ERICA5779-TestSub-PWT-103",
882 "name": "ERICA5779-TestSub-PWT-103",
886 "id": "ERICA5779-Subscriber-2",
887 "name": "ERICA5779-Subscriber-2",
891 "id": "e433710f-9217-458d-a79d-1c7aff376d89",
892 "name": "SILVIA ROBBINS",
896 "id": "ERICA5779-Subscriber-3",
897 "name": "ERICA5779-Subscriber-3",
901 "id": "31739f3e-526b-11e6-beb8-9e71128cae77",
902 "name": "CRAIG/ROBERTS",
911 class MockFeatureFlagsService {}
913 describe('VFModule Control Generator', () => {
915 let service: VfModuleControlGenerator;
916 let httpMock: HttpTestingController;
918 beforeAll(done => (async () => {
919 TestBed.configureTestingModule({
920 imports: [HttpClientTestingModule],
921 providers: [VfModuleControlGenerator,
923 SharedControllersService,
924 ControlGeneratorUtil,
928 {provide:FeatureFlagsService, useClass: MockFeatureFlagsService},
929 {provide: NgRedux, useClass: MockAppStore}]
931 await TestBed.compileComponents();
933 injector = getTestBed();
934 service = injector.get(VfModuleControlGenerator);
935 httpMock = injector.get(HttpTestingController);
936 jest.spyOn(console, 'error');
938 })().then(done).catch(done.fail));
940 test(' getMacroFormControls gets vnfStoreKey === null', () => {
941 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
942 const vnfStoreKey: string = null;
943 const vfModuleStoreKey: string = 'vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0';
944 const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830";
945 const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vfModuleStoreKey, vfModuleUUID, true);
947 expect(controls).toEqual([]);
948 expect(console.error).toHaveBeenCalled();
951 test('getAlaCarteFormControls check for mandatory controls', () => {
952 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
953 const vnfStoreKey: string = 'VF_vGeraldine 0';
954 const vfModuleStoreKey: string = 'vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0';
955 const uuidData: Object = {
956 modelId : "522159d5-d6e0-4c2a-aa44-5a542a12a830",
957 modelName : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0",
958 serviceId : "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
960 vFModuleStoreKey : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo",
961 vnfStoreKey : "VF_vGeraldine 0"
963 const controls: FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vfModuleStoreKey, uuidData, true);
965 const mandatoryControls : string[] = [
966 FormControlNames.INSTANCE_NAME,
967 FormControlNames.LCPCLOUD_REGION_ID,
968 FormControlNames.TENANT_ID,
969 FormControlNames.ROLLBACK_ON_FAILURE,
972 for(let i = 0 ; i < mandatoryControls.length ; i++) {
973 let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required');
974 expect(requiredExist).toBeDefined();
980 [true, true, true, null, true, true],
981 [true, true, false, null, true, false], //Scenario to check that UI field doesn't appear.
982 [false, true, false, "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0_vol", true, true],
983 [false, true, true, "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0_vol", true, true],
984 [false, false, true, null, false, false],
987 test.each(cases)('Given Ecomp Gen Name: %p and VG Name %p , ' +
988 'is A La Carte %p - expect the name value for VG to be %p , ' +
989 'VG Name should be defined: %p , and should the field be visible: %p',
990 (ecomGenName, vGName, isALaCarte, expectedName, shouldWeVerifyDefinitionOfField, isVisible) => {
991 const moduleName = "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0";
992 service.vfModuleModel = new VfModule();
993 service.vfModuleModel.name = moduleName;
994 service.vfModuleModel.volumeGroupAllowed = vGName;
995 let vnf : Object = {isEcompGeneratedNaming: ecomGenName};
996 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
997 const vnfStoreKey: string = 'VF_vGeraldine 0';
998 const uuidData: Object = {
999 modelName : moduleName,
1000 vFModuleStoreKey : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo",
1002 const vfModuleModel :VfModuleInstance = service.getVfModuleInstance(serviceId, vnfStoreKey, uuidData,true);
1003 let existingMatchingFieldInForm = buildVfModuleFormControlModel(vfModuleModel ,serviceId, vnf, isALaCarte);
1004 if (shouldWeVerifyDefinitionOfField) {
1005 expect(existingMatchingFieldInForm).toBeDefined();
1006 expect(existingMatchingFieldInForm.value).toEqual(expectedName);
1007 expect(existingMatchingFieldInForm.isVisible).toEqual(isVisible);
1009 expect(existingMatchingFieldInForm).toBeUndefined();
1013 let buildVfModuleFormControlModel = function(vfModuleModel :any, serviceId: string, vnf, isALaCarte) :FormControlModel {
1014 let controls: FormControlModel[] = service.pushInstanceAndVGToForm([], vfModuleModel, serviceId, vnf, isALaCarte);
1015 return controls.find(ctrl => ctrl.controlName === FormControlNames.VOLUME_GROUP_NAME);
1018 test('getMacroFormControls check for mandatory controls', () => {
1019 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1020 const vnfStoreKey: string = 'VF_vGeraldine 0';
1021 const uuidData: Object = {
1022 modelId : "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
1023 modelName : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0",
1024 serviceId : "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
1026 vFModuleStoreKey : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo",
1027 vnfStoreKey : "VF_vGeraldine 0"
1029 const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfStoreKey, uuidData, true);
1031 const mandatoryControls : string[] = [
1035 for(let i = 0 ; i < mandatoryControls.length ; i++) {
1036 let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required');
1037 expect(requiredExist).toBeDefined();
1041 test(' getMacroFormControls gets null vnfStoreKey', () => {
1042 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1043 const vnfStoreKey: string = null;
1044 const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830";
1045 const uuidData: Object = {};
1046 const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vfModuleUUID, uuidData,true);
1048 expect(controls).toEqual([]);
1049 expect(console.error).toHaveBeenCalled();
1052 test('getAlaCarteFormControls should return the correct order of controls', () => {
1053 const controls:FormControlModel[] = getAlaCarteFormControls();
1055 const orderedControls : string[] = [
1056 FormControlNames.INSTANCE_NAME,
1057 FormControlNames.VOLUME_GROUP_NAME,
1058 FormControlNames.LCPCLOUD_REGION_ID,
1059 FormControlNames.LEGACY_REGION,
1060 FormControlNames.TENANT_ID,
1061 FormControlNames.ROLLBACK_ON_FAILURE,
1065 expect(controls.length).toEqual(7);
1066 for(let i = 0 ; i < orderedControls.length ; i++) {
1067 expect(controls[i].controlName).toEqual(orderedControls[i]);
1071 function getAlaCarteFormControls():FormControlModel[] {
1072 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1073 const vnfStoreKey: string = 'VF_vGeraldine 0';
1074 const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830";
1075 const uuidData: Object = {
1076 modelId: "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
1077 modelName: "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0",
1078 serviceId: "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
1080 vFModuleStoreKey: "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo",
1081 vnfStoreKey: "VF_vGeraldine 0"
1083 const controls: FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vfModuleUUID, uuidData, true);
1087 test('getAlaCarteFormControls responce with wrong order of controls', () => {
1088 const controls:FormControlModel[] = getAlaCarteFormControls();
1090 const orderedControls : string[] = [
1091 FormControlNames.INSTANCE_NAME,
1092 FormControlNames.VOLUME_GROUP_NAME,
1093 FormControlNames.LCPCLOUD_REGION_ID,
1094 FormControlNames.TENANT_ID, // TENANT_ID must be after LEGACY_REGION
1095 FormControlNames.LEGACY_REGION,
1096 FormControlNames.ROLLBACK_ON_FAILURE,
1100 for(let i = 0 ; i < orderedControls.length ; i++) {
1101 if (controls[i].controlName === 'legacyRegion') {
1102 expect(orderedControls[i]).toEqual('tenantId');
1107 test('getMacroFormControls should return the correct order of controls', () => {
1108 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1109 const vnfStoreKey: string = 'VF_vGeraldine 0';
1110 const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830";
1111 const uuidData: Object = {
1112 modelId : "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
1113 modelName : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0",
1114 serviceId : "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
1116 vFModuleStoreKey : "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo",
1117 vnfStoreKey : "VF_vGeraldine 0"
1119 const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vfModuleUUID, uuidData, true);
1121 const orderedControls : string[] = [
1122 FormControlNames.INSTANCE_NAME,
1123 FormControlNames.VOLUME_GROUP_NAME
1126 for(let i = 0 ; i < orderedControls.length ; i++) {
1127 expect(controls[i].controlName).toEqual(orderedControls[i]);
1134 ${'volumeGroupName'}
1135 `('getAlacartFormControls $controllerName control validator shall have the expected regex', ({controllerName}) => {
1136 const controls:FormControlModel[] = getAlaCarteFormControls();
1138 const instanceNameControl: FormControlModel = <FormControlModel>controls.find(item => item.controlName == controllerName);
1139 const instanceNameValidator: ValidatorModel = instanceNameControl.validations.find(val => val.validatorName === ValidatorOptions.pattern);
1140 expect(instanceNameValidator.validatorArg).toEqual(/^[a-zA-Z0-9._-]*$/);
1143 test(' getAlaCarteFormControls gets null service', () => {
1144 const controls:FormControlModel[] = getAlaCarteFormControls();
1145 expect(controls.length).toEqual(7);
1147 const orderedControls : string[] = [
1148 FormControlNames.INSTANCE_NAME,
1149 FormControlNames.VOLUME_GROUP_NAME,
1150 FormControlNames.LCPCLOUD_REGION_ID,
1151 FormControlNames.LEGACY_REGION,
1152 FormControlNames.TENANT_ID,
1153 FormControlNames.ROLLBACK_ON_FAILURE,
1157 for(let i = 0 ; i < orderedControls.length ; i++) {
1158 expect(controls[i].controlName).toEqual(orderedControls[i]);