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 {FormControlNames} from "../service.control.generator";
5 import {ControlGeneratorUtil} from "../control.generator.util.service";
6 import {AaiService} from "../../../../services/aaiService/aai.service";
7 import {GenericFormService} from "../../generic-form.service";
8 import {FormBuilder} from "@angular/forms";
13 } from "../../../../models/formControlModels/formControl.model";
14 import {LogService} from "../../../../utils/log/log.service";
15 import {VnfControlGenerator} from "./vnf.control.generator";
16 import {FeatureFlagsService} from "../../../../services/featureFlag/feature-flags.service";
17 import {FormControlType} from "../../../../models/formControlModels/formControlTypes.enum";
18 import {SharedControllersService} from "../sharedControlles/shared.controllers.service";
20 class MockAppStore<T> {
26 "FLAG_NETWORK_TO_ASYNC_INSTANTIATION": false,
27 "FLAG_SHOW_ASSIGNMENTS": true,
28 "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true,
29 "FLAG_SHOW_VERIFY_SERVICE": false,
30 "FLAG_SERVICE_MODEL_CACHE": true,
31 "FLAG_ADD_MSO_TESTAPI_FIELD": true
33 "type": "[FLAGS] Update"
37 "6e59c5de-f052-46fa-aa7e-2fca9d674c44": {
39 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
40 "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
41 "name": "ComplexService",
43 "toscaModelURL": null,
44 "category": "Emanuel",
47 "description": "ComplexService",
48 "serviceEcompNaming": "false",
49 "instantiationType": "Macro",
54 "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60",
55 "invariantUuid": "4160458e-f648-4b30-a176-43881ffffe9e",
56 "description": "VSP_vGeraldine",
57 "name": "VF_vGeraldine",
59 "customizationUuid": "91415b44-753d-494c-926a-456a9172bbb9",
65 "gpb2_Internal2_mac": "00:11:22:EF:AC:DF",
66 "sctp-b-ipv6-egress_src_start_port": "0",
67 "sctp-a-ipv6-egress_rule_application": "any",
68 "Internal2_allow_transit": "true",
69 "sctp-b-IPv6_ethertype": "IPv6",
70 "sctp-a-egress_rule_application": "any",
71 "sctp-b-ingress_action": "pass",
72 "sctp-b-ingress_rule_protocol": "icmp",
73 "ncb2_Internal1_mac": "00:11:22:EF:AC:DF",
74 "sctp-b-ipv6-ingress-src_start_port": "0.0",
75 "ncb1_Internal2_mac": "00:11:22:EF:AC:DF",
76 "fsb_volume_size_0": "320.0",
77 "sctp-b-egress_src_addresses": "local",
78 "sctp-a-ipv6-ingress_ethertype": "IPv4",
79 "sctp-a-ipv6-ingress-dst_start_port": "0",
80 "sctp-b-ipv6-ingress_rule_application": "any",
81 "domain_name": "default-domain",
82 "sctp-a-ingress_rule_protocol": "icmp",
83 "sctp-b-egress-src_start_port": "0.0",
84 "sctp-a-egress_src_addresses": "local",
85 "sctp-b-display_name": "epc-sctp-b-ipv4v6-sec-group",
86 "sctp-a-egress-src_start_port": "0.0",
87 "sctp-a-ingress_ethertype": "IPv4",
88 "sctp-b-ipv6-ingress-dst_end_port": "65535",
89 "sctp-b-dst_subnet_prefix_v6": "::",
90 "nf_naming": "{ecomp_generated_naming=true}",
91 "sctp-a-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
92 "sctp-b-egress-dst_start_port": "0.0",
93 "ncb_flavor_name": "nv.c20r64d1",
94 "gpb1_Internal1_mac": "00:11:22:EF:AC:DF",
95 "sctp-b-egress_dst_subnet_prefix_len": "0.0",
96 "Internal2_net_cidr": "10.0.0.10",
97 "sctp-a-ingress-dst_start_port": "0.0",
98 "sctp-a-egress-dst_start_port": "0.0",
99 "fsb1_Internal2_mac": "00:11:22:EF:AC:DF",
100 "sctp-a-egress_ethertype": "IPv4",
101 "vlc_st_service_mode": "in-network-nat",
102 "sctp-a-ipv6-egress_ethertype": "IPv4",
103 "sctp-a-egress-src_end_port": "65535.0",
104 "sctp-b-ipv6-egress_rule_application": "any",
105 "sctp-b-egress_action": "pass",
106 "sctp-a-ingress-src_subnet_prefix_len": "0.0",
107 "sctp-b-ipv6-ingress-src_end_port": "65535.0",
108 "sctp-b-name": "epc-sctp-b-ipv4v6-sec-group",
109 "fsb2_Internal1_mac": "00:11:22:EF:AC:DF",
110 "sctp-a-ipv6-ingress-src_start_port": "0.0",
111 "sctp-b-ipv6-egress_ethertype": "IPv4",
112 "Internal1_net_cidr": "10.0.0.10",
113 "sctp-a-egress_dst_subnet_prefix": "0.0.0.0",
114 "fsb_flavor_name": "nv.c20r64d1",
115 "sctp_rule_protocol": "132",
116 "sctp-b-ipv6-ingress_src_subnet_prefix_len": "0",
117 "sctp-a-ipv6-ingress_rule_application": "any",
118 "ecomp_generated_naming": "false",
119 "sctp-a-IPv6_ethertype": "IPv6",
120 "vlc2_Internal1_mac": "00:11:22:EF:AC:DF",
121 "vlc_st_virtualization_type": "virtual-machine",
122 "sctp-b-ingress-dst_start_port": "0.0",
123 "sctp-b-ingress-dst_end_port": "65535.0",
124 "sctp-a-ipv6-ingress-src_end_port": "65535.0",
125 "sctp-a-display_name": "epc-sctp-a-ipv4v6-sec-group",
126 "sctp-b-ingress_rule_application": "any",
127 "int2_sec_group_name": "int2-sec-group",
128 "vlc_flavor_name": "nd.c16r64d1",
129 "sctp-b-ipv6-egress_src_addresses": "local",
130 "vlc_st_interface_type_int1": "other1",
131 "sctp-b-egress-src_end_port": "65535.0",
132 "sctp-a-ipv6-egress-dst_start_port": "0",
133 "vlc_st_interface_type_int2": "other2",
134 "sctp-a-ipv6-egress_rule_protocol": "any",
135 "Internal2_shared": "false",
136 "sctp-a-ipv6-egress_dst_subnet_prefix_len": "0",
137 "Internal2_rpf": "disable",
138 "vlc1_Internal1_mac": "00:11:22:EF:AC:DF",
139 "sctp-b-ipv6-egress_src_end_port": "65535",
140 "sctp-a-ipv6-egress_src_addresses": "local",
141 "sctp-a-ingress-dst_end_port": "65535.0",
142 "sctp-a-ipv6-egress_src_end_port": "65535",
143 "Internal1_forwarding_mode": "l2",
144 "Internal2_dhcp": "false",
145 "sctp-a-dst_subnet_prefix_v6": "::",
146 "pxe_image_name": "MME_PXE-Boot_16ACP04_GA.qcow2",
147 "vlc_st_interface_type_gtp": "other0",
148 "ncb1_Internal1_mac": "00:11:22:EF:AC:DF",
149 "sctp-b-src_subnet_prefix_v6": "::",
150 "sctp-a-egress_dst_subnet_prefix_len": "0.0",
151 "int1_sec_group_name": "int1-sec-group",
152 "Internal1_dhcp": "false",
153 "sctp-a-ipv6-egress_dst_end_port": "65535",
154 "Internal2_forwarding_mode": "l2",
155 "fsb2_Internal2_mac": "00:11:22:EF:AC:DF",
156 "sctp-b-egress_dst_subnet_prefix": "0.0.0.0",
157 "Internal1_net_cidr_len": "17",
158 "gpb2_Internal1_mac": "00:11:22:EF:AC:DF",
159 "sctp-b-ingress-src_subnet_prefix_len": "0.0",
160 "sctp-a-ingress_dst_addresses": "local",
161 "sctp-a-egress_action": "pass",
162 "fsb_volume_type_0": "SF-Default-SSD",
163 "ncb2_Internal2_mac": "00:11:22:EF:AC:DF",
164 "vlc_st_interface_type_sctp_a": "left",
165 "vlc_st_interface_type_sctp_b": "right",
166 "sctp-a-src_subnet_prefix_v6": "::",
167 "vlc_st_version": "2",
168 "sctp-b-egress_ethertype": "IPv4",
169 "sctp-a-ingress_rule_application": "any",
170 "gpb1_Internal2_mac": "00:11:22:EF:AC:DF",
171 "instance_ip_family_v6": "v6",
172 "sctp-a-ipv6-egress_src_start_port": "0",
173 "sctp-b-ingress-src_start_port": "0.0",
174 "sctp-b-ingress_dst_addresses": "local",
175 "fsb1_Internal1_mac": "00:11:22:EF:AC:DF",
176 "vlc_st_interface_type_oam": "management",
177 "multi_stage_design": "true",
178 "oam_sec_group_name": "oam-sec-group",
179 "Internal2_net_gateway": "10.0.0.10",
180 "sctp-a-ipv6-ingress-dst_end_port": "65535",
181 "sctp-b-ipv6-egress-dst_start_port": "0",
182 "Internal1_net_gateway": "10.0.0.10",
183 "sctp-b-ipv6-egress_rule_protocol": "any",
184 "gtp_sec_group_name": "gtp-sec-group",
185 "sctp-a-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
186 "sctp-b-ipv6-egress_dst_subnet_prefix_len": "0",
187 "sctp-a-ipv6-ingress_dst_addresses": "local",
188 "sctp-a-egress_rule_protocol": "icmp",
189 "sctp-b-ipv6-egress_action": "pass",
190 "sctp-a-ipv6-egress_action": "pass",
191 "Internal1_shared": "false",
192 "sctp-b-ipv6-ingress_rule_protocol": "any",
193 "Internal2_net_cidr_len": "17",
194 "sctp-a-name": "epc-sctp-a-ipv4v6-sec-group",
195 "sctp-a-ingress-src_end_port": "65535.0",
196 "sctp-b-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
197 "sctp-a-egress-dst_end_port": "65535.0",
198 "sctp-a-ingress_action": "pass",
199 "sctp-b-egress_rule_protocol": "icmp",
200 "sctp-b-ipv6-ingress_action": "pass",
201 "vlc_st_service_type": "firewall",
202 "sctp-b-ipv6-egress_dst_end_port": "65535",
203 "sctp-b-ipv6-ingress-dst_start_port": "0",
204 "vlc2_Internal2_mac": "00:11:22:EF:AC:DF",
205 "vlc_st_availability_zone": "true",
206 "fsb_volume_image_name_1": "MME_FSB2_16ACP04_GA.qcow2",
207 "sctp-b-ingress-src_subnet_prefix": "0.0.0.0",
208 "sctp-a-ipv6-ingress_src_subnet_prefix_len": "0",
209 "Internal1_allow_transit": "true",
210 "gpb_flavor_name": "nv.c20r64d1",
211 "availability_zone_max_count": "1",
212 "fsb_volume_image_name_0": "MME_FSB1_16ACP04_GA.qcow2",
213 "sctp-b-ipv6-ingress_dst_addresses": "local",
214 "sctp-b-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
215 "sctp-b-ipv6-ingress_ethertype": "IPv4",
216 "vlc1_Internal2_mac": "00:11:22:EF:AC:DF",
217 "sctp-a-ingress-src_subnet_prefix": "0.0.0.0",
218 "sctp-a-ipv6-ingress_action": "pass",
219 "Internal1_rpf": "disable",
220 "sctp-b-ingress_ethertype": "IPv4",
221 "sctp-b-egress_rule_application": "any",
222 "sctp-b-ingress-src_end_port": "65535.0",
223 "sctp-a-ipv6-ingress_rule_protocol": "any",
224 "sctp-a-ingress-src_start_port": "0.0",
225 "sctp-b-egress-dst_end_port": "65535.0"
228 "modelCustomizationName": "VF_vGeraldine 0",
230 "vf_vgeraldine0..VfVgeraldine..vflorence_vlc..module-1": {
231 "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
232 "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
233 "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
235 "name": "VfVgeraldine..vflorence_vlc..module-1",
237 "modelCustomizationName": "VfVgeraldine..vflorence_vlc..module-1",
239 "minCountInstances": 0,
240 "maxCountInstances": null,
242 "vfModuleLabel": "vflorence_vlc"
245 "volumeGroupAllowed": true
247 "vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2": {
248 "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
249 "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
250 "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
252 "name": "VfVgeraldine..vflorence_gpb..module-2",
254 "modelCustomizationName": "VfVgeraldine..vflorence_gpb..module-2",
256 "minCountInstances": 0,
257 "maxCountInstances": null,
259 "vfModuleLabel": "vflorence_gpb"
262 "volumeGroupAllowed": false
264 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
265 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
266 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
267 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
269 "name": "VfVgeraldine..base_vflorence..module-0",
271 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
273 "minCountInstances": 1,
274 "maxCountInstances": 1,
276 "vfModuleLabel": "base_vflorence"
279 "volumeGroupAllowed": true
283 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
284 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
285 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
286 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
288 "name": "VfVgeraldine..base_vflorence..module-0",
290 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
292 "minCountInstances": 1,
293 "maxCountInstances": 1,
295 "vfModuleLabel": "base_vflorence"
300 "vfcInstanceGroups": {}
305 "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986",
306 "invariantUuid": "379f816b-a7aa-422f-be30-17114ff50b7c",
307 "description": "ECOMP generic virtual link (network) base type for all other service-level and global networks",
310 "customizationUuid": "94fdd893-4a36-4d70-b16a-ec29c54c184f",
314 "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}}",
315 "exVL_naming": "{ecomp_generated_naming=true}",
316 "network_flows": "{is_network_policy=false, is_bound_to_vpn=false}",
317 "network_homing": "{ecomp_selected_instance_node_target=false}"
320 "modelCustomizationName": "ExtVL 0"
323 "collectionResources": {},
325 "Port Mirroring Configuration By Policy 0": {
326 "uuid": "b4398538-e89d-4f13-b33d-ca323434ba50",
327 "invariantUuid": "6ef0ca40-f366-4897-951f-abd65d25f6f7",
328 "description": "A port mirroring configuration by policy object",
329 "name": "Port Mirroring Configuration By Policy",
331 "customizationUuid": "3c3b7b8d-8669-4b3b-8664-61970041fad2",
335 "type": "Configuration",
336 "modelCustomizationName": "Port Mirroring Configuration By Policy 0",
338 "collectorNodes": null,
339 "configurationByPolicy": false
342 "serviceProxies": {},
344 "vf_vgeraldine0..VfVgeraldine..vflorence_vlc..module-1": {
345 "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
346 "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
347 "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
349 "name": "VfVgeraldine..vflorence_vlc..module-1",
351 "modelCustomizationName": "VfVgeraldine..vflorence_vlc..module-1",
353 "minCountInstances": 0,
354 "maxCountInstances": null,
356 "vfModuleLabel": "vflorence_vlc"
359 "volumeGroupAllowed": true
361 "vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2": {
362 "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
363 "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
364 "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
366 "name": "VfVgeraldine..vflorence_gpb..module-2",
368 "modelCustomizationName": "VfVgeraldine..vflorence_gpb..module-2",
370 "minCountInstances": 0,
371 "maxCountInstances": null,
373 "vfModuleLabel": "vflorence_gpb"
376 "volumeGroupAllowed": false
378 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
379 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
380 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
381 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
383 "name": "VfVgeraldine..base_vflorence..module-0",
385 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
387 "minCountInstances": 1,
388 "maxCountInstances": 1,
390 "vfModuleLabel": "base_vflorence"
393 "volumeGroupAllowed": true
397 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
398 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
399 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
400 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
402 "name": "VfVgeraldine..base_vflorence..module-0",
404 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
406 "minCountInstances": 1,
407 "maxCountInstances": 1,
409 "vfModuleLabel": "base_vflorence"
418 "6e59c5de-f052-46fa-aa7e-2fca9d674c44": {
421 "rollbackOnFailure": "true",
423 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
424 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo": {
425 "isMissingData": false,
426 "sdncPreReload": null,
428 "modelType": "VFmodule",
429 "modelInvariantId": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
430 "modelVersionId": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
431 "modelName": "VfVgeraldine..base_vflorence..module-0",
433 "modelCustomizationId": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
434 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0"
439 "trackById": "wmtm6sy2uj"
443 "isMissingData": true,
444 "originalName": "VF_vGeraldine 0",
445 "vnfStoreKey": "VF_vGeraldine 0",
446 "trackById": "p3wk448m5do",
447 "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60",
448 "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
449 "lcpCloudRegionId": null,
451 "lineOfBusiness": null,
452 "platformName": null,
455 "modelInvariantId": "4160458e-f648-4b30-a176-43881ffffe9e",
456 "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
457 "modelName": "VF_vGeraldine",
458 "modelVersion": "2.0",
459 "modelCustomizationName": "VF_vGeraldine 0"
466 "validationCounter": 1,
468 "existingVNFCounterMap": {
469 "d6557200-ecf2-4641-8094-5393ae3aae60": 1
471 "globalSubscriberId": "e433710f-9217-458d-a79d-1c7aff376d89",
472 "subscriptionServiceType": "TYLER SILVIA",
473 "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
474 "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
475 "lcpCloudRegionId": "hvf6",
476 "tenantId": "229bcdc6eaeb4ca59d55221141d01f8e",
479 "rollbackOnFailure": "true",
482 "modelInvariantId": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
483 "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
484 "modelName": "ComplexService",
485 "modelVersion": "1.0",
486 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44"
489 "name": "ComplexService",
491 "description": "ComplexService",
492 "category": "Emanuel",
493 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
494 "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
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 {
912 getFlagState = () => false;
915 describe('VNF Control Generator', () => {
917 let service: VnfControlGenerator;
918 let httpMock: HttpTestingController;
921 beforeAll(done => (async () => {
922 TestBed.configureTestingModule({
923 imports: [HttpClientTestingModule],
924 providers: [VnfControlGenerator,
926 ControlGeneratorUtil,
927 SharedControllersService,
931 {provide:FeatureFlagsService, useClass: MockFeatureFlagsService},
932 {provide: NgRedux, useClass: MockAppStore}]
934 await TestBed.compileComponents();
937 injector = getTestBed();
938 service = injector.get(VnfControlGenerator);
939 httpMock = injector.get(HttpTestingController);
941 })().then(done).catch(done.fail));
944 test('should generate platform multi select control', ()=>{
945 const control = service.getPlatformMultiselectControl(null, [],false);
946 expect(control.type).toEqual(FormControlType.MULTI_SELECT);
947 expect(control.controlName).toEqual('platformName');
948 expect(control.displayName).toEqual('Platform');
949 expect(control.dataTestId).toEqual('multi-selectPlatform');
950 expect(control.selectedFieldName).toEqual('name');
951 expect(control.value).toEqual('');
952 expect(control.onChange).toBeDefined();
953 expect(control.convertOriginalDataToArray).toBeDefined();
956 test('getMacroFormControls check for mandatory controls', () => {
957 const serviceId : string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
958 const vnfName : string = "VF_vGeraldine 0";
959 const vnfStoreKey : string = "VF_vGeraldine 0";
960 const controls :FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfName, []);
962 const mandatoryControls : string[] = [
963 FormControlNames.INSTANCE_NAME,
964 FormControlNames.LCPCLOUD_REGION_ID,
965 FormControlNames.TENANT_ID,
967 FormControlNames.PRODUCT_FAMILY_ID
970 for(let i = 0 ; i < mandatoryControls.length ; i++){
971 let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required');
972 expect(requiredExist).toBeDefined();
976 test('should provide empty array on getMacroFormControls when serviceId, vnfName and vnfStoreKey equals to null', () => {
978 let vnfStoreKey = null;
979 const serviceId = null;
980 const vnfName : string = null;
981 const result:FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfName, []);
982 expect(result).toEqual([]);
985 test('should provide empty array on getAlaCarteFormControls when serviceId, vnfName and vnfStoreKey equals to null', () => {
986 let vnfStoreKey = null;
987 const serviceId = null;
988 const vnfName : string = null;
989 const result:FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vnfName, []);
990 expect(result).toEqual([]);
993 function getALaCarteFormControls(vnfStoreKey: string): FormControlModel[] {
994 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
995 const vnfName: string = "VF_vGeraldine 0";
996 const controls: FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vnfName, []);
1000 test('getMacroFormControls should return the correct order of controls', () => {
1001 const serviceId : string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1002 const vnfName : string = "VF_vGeraldine 0";
1003 const vnfStoreKey : string = null;
1004 const controls :FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfName, []);
1006 const controlsOrderNames = [
1007 FormControlNames.INSTANCE_NAME,
1008 FormControlNames.PRODUCT_FAMILY_ID,
1009 FormControlNames.LCPCLOUD_REGION_ID ,
1015 expect(controls.length).toEqual(7);
1016 for(let i = 0 ; i < controls.length ; i++){
1017 expect(controls[i].controlName).toEqual(controlsOrderNames[i]);
1021 test('getAlacartFormControls should return the correct order of controls', () => {
1022 const controls = getALaCarteFormControls(null);
1024 const controlsOrderNames = [
1025 FormControlNames.INSTANCE_NAME,
1026 FormControlNames.PRODUCT_FAMILY_ID,
1027 FormControlNames.LCPCLOUD_REGION_ID,
1032 'rollbackOnFailure'];
1033 expect(controls.length).toEqual(8);
1034 for(let i = 0 ; i < controls.length ; i++) {
1035 expect(controls[i].controlName).toEqual(controlsOrderNames[i]);
1040 test('getAlacartFormControls check for mandatory controls', () => {
1041 const controls = getALaCarteFormControls("VF_vGeraldine 0");
1042 const mandatoryControls : string[] = [
1043 FormControlNames.INSTANCE_NAME,
1044 FormControlNames.LCPCLOUD_REGION_ID,
1050 for(let i = 0 ; i < mandatoryControls.length ; i++){
1051 let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required');
1052 expect(requiredExist).toBeDefined();
1056 test('getAlacartFormControls instance name control validator shall have the expected regex', () => {
1057 const controls:FormControlModel[] = getALaCarteFormControls("VF_vGeraldine 0");
1059 const instanceNameControl: FormControlModel = <FormControlModel>controls.find(item => item.controlName === FormControlNames.INSTANCE_NAME);
1060 const instanceNameValidator: ValidatorModel = instanceNameControl.validations.find(val => val.validatorName === ValidatorOptions.pattern);
1061 expect(instanceNameValidator.validatorArg).toEqual(/^[a-zA-Z0-9._-]*$/);