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 {BasicControlGenerator} from "../basic.control.generator";
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";
17 class MockAppStore<T> {
23 "FLAG_NETWORK_TO_ASYNC_INSTANTIATION": false,
24 "FLAG_SHOW_ASSIGNMENTS": true,
25 "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true,
26 "FLAG_UNASSIGN_SERVICE": true,
27 "FLAG_SHOW_VERIFY_SERVICE": false,
28 "FLAG_COLLECTION_RESOURCE_SUPPORT": true,
29 "FLAG_DUPLICATE_VNF": true,
30 "FLAG_SERVICE_MODEL_CACHE": true,
31 "CREATE_INSTANCE_TEST": false,
32 "FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD": false,
33 "FLAG_ASYNC_INSTANTIATION": true,
34 "FLAG_ASYNC_JOBS": true,
35 "EMPTY_DRAWING_BOARD_TEST": false,
36 "FLAG_ADD_MSO_TESTAPI_FIELD": true
38 "type": "[FLAGS] Update"
42 "6e59c5de-f052-46fa-aa7e-2fca9d674c44": {
44 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
45 "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
46 "name": "ComplexService",
48 "toscaModelURL": null,
49 "category": "Emanuel",
52 "description": "ComplexService",
53 "serviceEcompNaming": "false",
54 "instantiationType": "Macro",
59 "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60",
60 "invariantUuid": "4160458e-f648-4b30-a176-43881ffffe9e",
61 "description": "VSP_vMee",
64 "customizationUuid": "91415b44-753d-494c-926a-456a9172bbb9",
67 "serviceEcompNaming" : "true",
69 "ecomp_generated_naming": "false",
72 "gpb2_Internal2_mac": "00:11:22:EF:AC:DF",
73 "sctp-b-ipv6-egress_src_start_port": "0",
74 "sctp-a-ipv6-egress_rule_application": "any",
75 "Internal2_allow_transit": "true",
76 "sctp-b-IPv6_ethertype": "IPv6",
77 "sctp-a-egress_rule_application": "any",
78 "sctp-b-ingress_action": "pass",
79 "sctp-b-ingress_rule_protocol": "icmp",
80 "ncb2_Internal1_mac": "00:11:22:EF:AC:DF",
81 "sctp-b-ipv6-ingress-src_start_port": "0.0",
82 "ncb1_Internal2_mac": "00:11:22:EF:AC:DF",
83 "fsb_volume_size_0": "320.0",
84 "sctp-b-egress_src_addresses": "local",
85 "sctp-a-ipv6-ingress_ethertype": "IPv4",
86 "sctp-a-ipv6-ingress-dst_start_port": "0",
87 "sctp-b-ipv6-ingress_rule_application": "any",
88 "domain_name": "default-domain",
89 "sctp-a-ingress_rule_protocol": "icmp",
90 "sctp-b-egress-src_start_port": "0.0",
91 "sctp-a-egress_src_addresses": "local",
92 "sctp-b-display_name": "epc-sctp-b-ipv4v6-sec-group",
93 "sctp-a-egress-src_start_port": "0.0",
94 "sctp-a-ingress_ethertype": "IPv4",
95 "sctp-b-ipv6-ingress-dst_end_port": "65535",
96 "sctp-b-dst_subnet_prefix_v6": "::",
97 "nf_naming": "{ecomp_generated_naming=true}",
98 "sctp-a-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
99 "sctp-b-egress-dst_start_port": "0.0",
100 "ncb_flavor_name": "nv.c20r64d1",
101 "gpb1_Internal1_mac": "00:11:22:EF:AC:DF",
102 "sctp-b-egress_dst_subnet_prefix_len": "0.0",
103 "Internal2_net_cidr": "10.0.0.10",
104 "sctp-a-ingress-dst_start_port": "0.0",
105 "sctp-a-egress-dst_start_port": "0.0",
106 "fsb1_Internal2_mac": "00:11:22:EF:AC:DF",
107 "sctp-a-egress_ethertype": "IPv4",
108 "vlc_st_service_mode": "in-network-nat",
109 "sctp-a-ipv6-egress_ethertype": "IPv4",
110 "sctp-a-egress-src_end_port": "65535.0",
111 "sctp-b-ipv6-egress_rule_application": "any",
112 "sctp-b-egress_action": "pass",
113 "sctp-a-ingress-src_subnet_prefix_len": "0.0",
114 "sctp-b-ipv6-ingress-src_end_port": "65535.0",
115 "sctp-b-name": "epc-sctp-b-ipv4v6-sec-group",
116 "fsb2_Internal1_mac": "00:11:22:EF:AC:DF",
117 "sctp-a-ipv6-ingress-src_start_port": "0.0",
118 "sctp-b-ipv6-egress_ethertype": "IPv4",
119 "Internal1_net_cidr": "10.0.0.10",
120 "sctp-a-egress_dst_subnet_prefix": "0.0.0.0",
121 "fsb_flavor_name": "nv.c20r64d1",
122 "sctp_rule_protocol": "132",
123 "sctp-b-ipv6-ingress_src_subnet_prefix_len": "0",
124 "sctp-a-ipv6-ingress_rule_application": "any",
125 "sctp-a-IPv6_ethertype": "IPv6",
126 "vlc2_Internal1_mac": "00:11:22:EF:AC:DF",
127 "vlc_st_virtualization_type": "virtual-machine",
128 "sctp-b-ingress-dst_start_port": "0.0",
129 "sctp-b-ingress-dst_end_port": "65535.0",
130 "sctp-a-ipv6-ingress-src_end_port": "65535.0",
131 "sctp-a-display_name": "epc-sctp-a-ipv4v6-sec-group",
132 "sctp-b-ingress_rule_application": "any",
133 "int2_sec_group_name": "int2-sec-group",
134 "vlc_flavor_name": "nd.c16r64d1",
135 "sctp-b-ipv6-egress_src_addresses": "local",
136 "vlc_st_interface_type_int1": "other1",
137 "sctp-b-egress-src_end_port": "65535.0",
138 "sctp-a-ipv6-egress-dst_start_port": "0",
139 "vlc_st_interface_type_int2": "other2",
140 "sctp-a-ipv6-egress_rule_protocol": "any",
141 "Internal2_shared": "false",
142 "sctp-a-ipv6-egress_dst_subnet_prefix_len": "0",
143 "Internal2_rpf": "disable",
144 "vlc1_Internal1_mac": "00:11:22:EF:AC:DF",
145 "sctp-b-ipv6-egress_src_end_port": "65535",
146 "sctp-a-ipv6-egress_src_addresses": "local",
147 "sctp-a-ingress-dst_end_port": "65535.0",
148 "sctp-a-ipv6-egress_src_end_port": "65535",
149 "Internal1_forwarding_mode": "l2",
150 "Internal2_dhcp": "false",
151 "sctp-a-dst_subnet_prefix_v6": "::",
152 "pxe_image_name": "MME_PXE-Boot_16ACP04_GA.qcow2",
153 "vlc_st_interface_type_gtp": "other0",
154 "ncb1_Internal1_mac": "00:11:22:EF:AC:DF",
155 "sctp-b-src_subnet_prefix_v6": "::",
156 "sctp-a-egress_dst_subnet_prefix_len": "0.0",
157 "int1_sec_group_name": "int1-sec-group",
158 "Internal1_dhcp": "false",
159 "sctp-a-ipv6-egress_dst_end_port": "65535",
160 "Internal2_forwarding_mode": "l2",
161 "fsb2_Internal2_mac": "00:11:22:EF:AC:DF",
162 "sctp-b-egress_dst_subnet_prefix": "0.0.0.0",
163 "Internal1_net_cidr_len": "17",
164 "gpb2_Internal1_mac": "00:11:22:EF:AC:DF",
165 "sctp-b-ingress-src_subnet_prefix_len": "0.0",
166 "sctp-a-ingress_dst_addresses": "local",
167 "sctp-a-egress_action": "pass",
168 "fsb_volume_type_0": "SF-Default-SSD",
169 "ncb2_Internal2_mac": "00:11:22:EF:AC:DF",
170 "vlc_st_interface_type_sctp_a": "left",
171 "vlc_st_interface_type_sctp_b": "right",
172 "sctp-a-src_subnet_prefix_v6": "::",
173 "vlc_st_version": "2",
174 "sctp-b-egress_ethertype": "IPv4",
175 "sctp-a-ingress_rule_application": "any",
176 "gpb1_Internal2_mac": "00:11:22:EF:AC:DF",
177 "instance_ip_family_v6": "v6",
178 "sctp-a-ipv6-egress_src_start_port": "0",
179 "sctp-b-ingress-src_start_port": "0.0",
180 "sctp-b-ingress_dst_addresses": "local",
181 "fsb1_Internal1_mac": "00:11:22:EF:AC:DF",
182 "vlc_st_interface_type_oam": "management",
183 "multi_stage_design": "true",
184 "oam_sec_group_name": "oam-sec-group",
185 "Internal2_net_gateway": "10.0.0.10",
186 "sctp-a-ipv6-ingress-dst_end_port": "65535",
187 "sctp-b-ipv6-egress-dst_start_port": "0",
188 "Internal1_net_gateway": "10.0.0.10",
189 "sctp-b-ipv6-egress_rule_protocol": "any",
190 "gtp_sec_group_name": "gtp-sec-group",
191 "sctp-a-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
192 "sctp-b-ipv6-egress_dst_subnet_prefix_len": "0",
193 "sctp-a-ipv6-ingress_dst_addresses": "local",
194 "sctp-a-egress_rule_protocol": "icmp",
195 "sctp-b-ipv6-egress_action": "pass",
196 "sctp-a-ipv6-egress_action": "pass",
197 "Internal1_shared": "false",
198 "sctp-b-ipv6-ingress_rule_protocol": "any",
199 "Internal2_net_cidr_len": "17",
200 "sctp-a-name": "epc-sctp-a-ipv4v6-sec-group",
201 "sctp-a-ingress-src_end_port": "65535.0",
202 "sctp-b-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
203 "sctp-a-egress-dst_end_port": "65535.0",
204 "sctp-a-ingress_action": "pass",
205 "sctp-b-egress_rule_protocol": "icmp",
206 "sctp-b-ipv6-ingress_action": "pass",
207 "vlc_st_service_type": "firewall",
208 "sctp-b-ipv6-egress_dst_end_port": "65535",
209 "sctp-b-ipv6-ingress-dst_start_port": "0",
210 "vlc2_Internal2_mac": "00:11:22:EF:AC:DF",
211 "vlc_st_availability_zone": "true",
212 "fsb_volume_image_name_1": "MME_FSB2_16ACP04_GA.qcow2",
213 "sctp-b-ingress-src_subnet_prefix": "0.0.0.0",
214 "sctp-a-ipv6-ingress_src_subnet_prefix_len": "0",
215 "Internal1_allow_transit": "true",
216 "gpb_flavor_name": "nv.c20r64d1",
217 "availability_zone_max_count": "1",
218 "fsb_volume_image_name_0": "MME_FSB1_16ACP04_GA.qcow2",
219 "sctp-b-ipv6-ingress_dst_addresses": "local",
220 "sctp-b-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
221 "sctp-b-ipv6-ingress_ethertype": "IPv4",
222 "vlc1_Internal2_mac": "00:11:22:EF:AC:DF",
223 "sctp-a-ingress-src_subnet_prefix": "0.0.0.0",
224 "sctp-a-ipv6-ingress_action": "pass",
225 "Internal1_rpf": "disable",
226 "sctp-b-ingress_ethertype": "IPv4",
227 "sctp-b-egress_rule_application": "any",
228 "sctp-b-ingress-src_end_port": "65535.0",
229 "sctp-a-ipv6-ingress_rule_protocol": "any",
230 "sctp-a-ingress-src_start_port": "0.0",
231 "sctp-b-egress-dst_end_port": "65535.0"
234 "modelCustomizationName": "VF_vMee 0",
236 "vf_vmee0..VfVmee..vmme_vlc..module-1": {
237 "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
238 "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
239 "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
241 "name": "VfVmee..vmme_vlc..module-1",
243 "modelCustomizationName": "VfVmee..vmme_vlc..module-1",
245 "minCountInstances": 0,
246 "maxCountInstances": null,
248 "vfModuleLabel": "vmme_vlc"
251 "volumeGroupAllowed": true
253 "vf_vmee0..VfVmee..vmme_gpb..module-2": {
254 "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
255 "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
256 "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
258 "name": "VfVmee..vmme_gpb..module-2",
260 "modelCustomizationName": "VfVmee..vmme_gpb..module-2",
262 "minCountInstances": 0,
263 "maxCountInstances": null,
265 "vfModuleLabel": "vmme_gpb"
268 "volumeGroupAllowed": false
270 "vf_vmee0..VfVmee..base_vmme..module-0": {
271 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
272 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
273 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
275 "name": "VfVmee..base_vmme..module-0",
277 "modelCustomizationName": "VfVmee..base_vmme..module-0",
279 "minCountInstances": 1,
280 "maxCountInstances": 1,
282 "vfModuleLabel": "base_vmme"
285 "volumeGroupAllowed": true
289 "vf_vmee0..VfVmee..base_vmme..module-0": {
290 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
291 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
292 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
294 "name": "VfVmee..base_vmme..module-0",
296 "modelCustomizationName": "VfVmee..base_vmme..module-0",
298 "minCountInstances": 1,
299 "maxCountInstances": 1,
301 "vfModuleLabel": "base_vmme"
306 "vfcInstanceGroups": {}
311 "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986",
312 "invariantUuid": "379f816b-a7aa-422f-be30-17114ff50b7c",
313 "description": "ECOMP generic virtual link (network) base type for all other service-level and global networks",
316 "customizationUuid": "94fdd893-4a36-4d70-b16a-ec29c54c184f",
320 "ecomp_generated_naming": "false",
321 "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}}",
322 "exVL_naming": "{ecomp_generated_naming=true}",
323 "network_flows": "{is_network_policy=false, is_bound_to_vpn=false}",
324 "network_homing": "{ecomp_selected_instance_node_target=false}"
327 "modelCustomizationName": "ExtVL 0"
330 "collectionResource": {},
332 "Port Mirroring Configuration By Policy 0": {
333 "uuid": "b4398538-e89d-4f13-b33d-ca323434ba50",
334 "invariantUuid": "6ef0ca40-f366-4897-951f-abd65d25f6f7",
335 "description": "A port mirroring configuration by policy object",
336 "name": "Port Mirroring Configuration By Policy",
338 "customizationUuid": "3c3b7b8d-8669-4b3b-8664-61970041fad2",
342 "type": "Configuration",
343 "modelCustomizationName": "Port Mirroring Configuration By Policy 0",
345 "collectorNodes": null,
346 "configurationByPolicy": false
349 "serviceProxies": {},
351 "vf_vmee0..VfVmee..vmme_vlc..module-1": {
352 "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
353 "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
354 "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
356 "name": "VfVmee..vmme_vlc..module-1",
358 "modelCustomizationName": "VfVmee..vmme_vlc..module-1",
360 "minCountInstances": 0,
361 "maxCountInstances": null,
363 "vfModuleLabel": "vmme_vlc"
366 "volumeGroupAllowed": true
368 "vf_vmee0..VfVmee..vmme_gpb..module-2": {
369 "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
370 "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
371 "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
373 "name": "VfVmee..vmme_gpb..module-2",
375 "modelCustomizationName": "VfVmee..vmme_gpb..module-2",
377 "minCountInstances": 0,
378 "maxCountInstances": null,
380 "vfModuleLabel": "vmme_gpb"
383 "volumeGroupAllowed": false
385 "vf_vmee0..VfVmee..base_vmme..module-0": {
386 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
387 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
388 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
390 "name": "VfVmee..base_vmme..module-0",
392 "modelCustomizationName": "VfVmee..base_vmme..module-0",
394 "minCountInstances": 1,
395 "maxCountInstances": 1,
397 "vfModuleLabel": "base_vmme"
400 "volumeGroupAllowed": true
404 "vf_vmee0..VfVmee..base_vmme..module-0": {
405 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
406 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
407 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
409 "name": "VfVmee..base_vmme..module-0",
411 "modelCustomizationName": "VfVmee..base_vmme..module-0",
413 "minCountInstances": 1,
414 "maxCountInstances": 1,
416 "vfModuleLabel": "base_vmme"
425 "6e59c5de-f052-46fa-aa7e-2fca9d674c44": {
429 "rollbackOnFailure": "true",
431 "vf_vmee0..VfVmee..base_vmme..module-0": {
432 "vf_vmee0..VfVmee..base_vmme..module-0vmvzo": {
433 "isMissingData": false,
434 "sdncPreReload": null,
436 "modelType": "VFmodule",
437 "modelInvariantId": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
438 "modelVersionId": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
439 "modelName": "VfVmee..base_vmme..module-0",
441 "modelCustomizationId": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
442 "modelCustomizationName": "VfVmee..base_vmme..module-0"
447 "trackById": "wmtm6sy2uj"
451 "isMissingData": true,
452 "originalName": "VF_vMee 0",
453 "vnfStoreKey": "VF_vMee 0",
454 "trackById": "p3wk448m5do",
455 "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60",
456 "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
457 "lcpCloudRegionId": null,
459 "lineOfBusiness": null,
460 "platformName": null,
463 "modelInvariantId": "4160458e-f648-4b30-a176-43881ffffe9e",
464 "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
465 "modelName": "VF_vMee",
466 "modelVersion": "2.0",
467 "modelCustomizationName": "VF_vMee 0"
474 "validationCounter": 1,
476 "existingVNFCounterMap": {
477 "d6557200-ecf2-4641-8094-5393ae3aae60": 1
479 "globalSubscriberId": "e433710f-9217-458d-a79d-1c7aff376d89",
480 "subscriptionServiceType": "TYLER SILVIA",
481 "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
482 "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
483 "lcpCloudRegionId": "hvf6",
484 "tenantId": "229bcdc6eaeb4ca59d55221141d01f8e",
487 "rollbackOnFailure": "true",
490 "modelInvariantId": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
491 "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
492 "modelName": "ComplexService",
493 "modelVersion": "1.0",
494 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44"
497 "name": "ComplexService",
499 "description": "ComplexService",
500 "category": "Emanuel",
501 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
502 "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
505 "isEcompGeneratedNaming": true,
506 "isMultiStepDesign": false
509 "lcpRegionsAndTenants": {
522 "lcpRegionsTenantsMap": {
525 "id": "092eb9e8e4b7412e8787dd091bc58e86",
526 "name": "USP-SIP-IC-24335-T-01",
532 "id": "bae71557c5bb4d5aac6743a4e5f1d054",
533 "name": "AIN Web Tool-15-D-testalexandria",
537 "id": "d0a3e3f2964542259d155a81c41aadc3",
538 "name": "test-hvf6-09",
542 "id": "fa45ca53c80b492fa8be5477cd84fc2b",
547 "id": "cbb99fe4ada84631b7baf046b6fd2044",
548 "name": "DN5242-Nov16-T3",
556 "id": "ebc3bc3d-62fd-4a3f-a037-f619df4ff034",
561 "id": "17cc1042-527b-11e6-beb8-9e71128cae77",
566 "id": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
571 "id": "a4f6f2ae-9bf5-4ed7-b904-06b2099c4bd7",
572 "name": "Enhanced Services",
581 "id": "323d69d9-2efe-4r45-ay0a-89ea7ard4e6f",
586 "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
591 "id": "d8a6ed93-251c-47ca-adc9-86671fd19f4c",
596 "id": "db171b8f-115c-4992-a2e3-ee04cae357e0",
616 "id": "e433710f-9217-458d-a79d-1c7aff376d89",
617 "name": "TYLER SILVIA",
621 "id": "b6a3f28c-eebf-494c-a900-055cc7c874ce",
631 "id": "0ee8c1bc-7cbd-4b0a-a1ac-e9999255abc1",
632 "name": "CARA Griffin",
636 "id": "c7611ebe-c324-48f1-8085-94aef0c6ef3d",
637 "name": "DARREN MCGEE",
641 "id": "e30755dc-5673-4b6b-9dcf-9abdd96b93d1",
647 "name": "vSalvatore",
651 "id": "d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4",
661 "id": "12a96a9d-4b4c-4349-a950-fe1159602621",
662 "name": "DARREN MCGEE",
667 "e433710f-9217-458d-a79d-1c7aff376d89": [
670 "name": "vRichardson",
675 "name": "TYLER SILVIA",
690 "name": "vVoiceMail",
755 "name": "JOHANNA_SANTOS",
768 "name": "NFTJSSSS-NFT1"
772 "name": "YUDFJULP-JAG1"
776 "name": "UUUAIAAI-YYY1"
780 "name": "AVTRFLHD-AVT1"
784 "name": "ATLSANAI-ATL34"
787 "categoryParameters": {
788 "owningEntityList": [
794 "id": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
795 "name": "WayneHolland"
816 "lineOfBusinessList": [
837 "type": "[LCP_REGIONS_AND_TENANTS] Update",
841 "name": "CAR_2020_ER",
845 "id": "21014aa2-526b-11e6-beb8-9e71128cae77",
846 "name": "JULIO ERICKSON",
850 "id": "DHV1707-TestSubscriber-2",
851 "name": "DALE BRIDGES",
855 "id": "DHV1707-TestSubscriber-1",
856 "name": "LLOYD BRIDGES",
860 "id": "jimmy-example",
861 "name": "JimmyExampleCust-20161102",
865 "id": "jimmy-example2",
866 "name": "JimmyExampleCust-20161103",
870 "id": "ERICA5779-TestSub-PWT-102",
871 "name": "ERICA5779-TestSub-PWT-102",
875 "id": "ERICA5779-TestSub-PWT-101",
876 "name": "ERICA5779-TestSub-PWT-101",
880 "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
885 "id": "ERICA5779-Subscriber-4",
886 "name": "ERICA5779-Subscriber-5",
890 "id": "ERICA5779-TestSub-PWT-103",
891 "name": "ERICA5779-TestSub-PWT-103",
895 "id": "ERICA5779-Subscriber-2",
896 "name": "ERICA5779-Subscriber-2",
900 "id": "e433710f-9217-458d-a79d-1c7aff376d89",
901 "name": "SILVIA ROBBINS",
905 "id": "ERICA5779-Subscriber-3",
906 "name": "ERICA5779-Subscriber-3",
910 "id": "31739f3e-526b-11e6-beb8-9e71128cae77",
911 "name": "CRAIG/ROBERTS",
920 class MockFeatureFlagsService {}
922 describe('VFModule Control Generator', () => {
924 let service: VfModuleControlGenerator;
925 let httpMock: HttpTestingController;
927 beforeAll(done => (async () => {
928 TestBed.configureTestingModule({
929 imports: [HttpClientTestingModule],
930 providers: [VfModuleControlGenerator,
932 BasicControlGenerator,
936 {provide:FeatureFlagsService, useClass: MockFeatureFlagsService},
937 {provide: NgRedux, useClass: MockAppStore}]
939 await TestBed.compileComponents();
941 injector = getTestBed();
942 service = injector.get(VfModuleControlGenerator);
943 httpMock = injector.get(HttpTestingController);
944 jest.spyOn(console, 'error');
946 })().then(done).catch(done.fail));
948 test(' getMacroFormControls gets vnfStoreKey === null', () => {
949 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
950 const vnfStoreKey: string = null;
951 const vfModuleStoreKey: string = 'vf_vmee0..VfVmee..base_vmme..module-0';
952 const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830";
953 const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vfModuleStoreKey, vfModuleUUID, true);
955 expect(controls).toEqual([]);
956 expect(console.error).toHaveBeenCalled();
959 test('getAlaCarteFormControls check for mandatory controls', () => {
960 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
961 const vnfStoreKey: string = 'VF_vMee 0';
962 const vfModuleStoreKey: string = 'vf_vmee0..VfVmee..base_vmme..module-0';
963 const uuidData: Object = {
964 modelId : "522159d5-d6e0-4c2a-aa44-5a542a12a830",
965 modelName : "vf_vmee0..VfVmee..base_vmme..module-0",
966 serviceId : "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
968 vFModuleStoreKey : "vf_vmee0..VfVmee..base_vmme..module-0vmvzo",
969 vnfStoreKey : "VF_vMee 0"
971 const controls: FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vfModuleStoreKey, uuidData, true);
973 const mandatoryControls : string[] = [
974 FormControlNames.INSTANCE_NAME,
975 FormControlNames.LCPCLOUD_REGION_ID,
976 FormControlNames.TENANT_ID,
977 FormControlNames.ROLLBACK_ON_FAILURE,
980 for(let i = 0 ; i < mandatoryControls.length ; i++) {
981 let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required');
982 expect(requiredExist).toBeDefined();
986 test('getMacroFormControls check for mandatory controls', () => {
987 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
988 const vnfStoreKey: string = 'VF_vMee 0';
989 const uuidData: Object = {
990 modelId : "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
991 modelName : "vf_vmee0..VfVmee..base_vmme..module-0",
992 serviceId : "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
994 vFModuleStoreKey : "vf_vmee0..VfVmee..base_vmme..module-0vmvzo",
995 vnfStoreKey : "VF_vMee 0"
997 const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfStoreKey, uuidData, true);
999 const mandatoryControls : string[] = [
1003 for(let i = 0 ; i < mandatoryControls.length ; i++) {
1004 let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required');
1005 expect(requiredExist).toBeDefined();
1009 test(' getMacroFormControls gets null vnfStoreKey', () => {
1010 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1011 const vnfStoreKey: string = null;
1012 const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830";
1013 const uuidData: Object = {};
1014 const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vfModuleUUID, uuidData,true);
1016 expect(controls).toEqual([]);
1017 expect(console.error).toHaveBeenCalled();
1020 test('getAlaCarteFormControls should return the correct order of controls', () => {
1021 const controls:FormControlModel[] = getAlaCarteFormControls();
1023 const orderedControls : string[] = [
1024 FormControlNames.INSTANCE_NAME,
1025 FormControlNames.VOLUME_GROUP_NAME,
1026 FormControlNames.LCPCLOUD_REGION_ID,
1027 FormControlNames.LEGACY_REGION,
1028 FormControlNames.TENANT_ID,
1029 FormControlNames.ROLLBACK_ON_FAILURE,
1030 FormControlNames.SDN_C_PRE_LOAD
1033 expect(controls.length).toEqual(7);
1034 for(let i = 0 ; i < orderedControls.length ; i++) {
1035 expect(controls[i].controlName).toEqual(orderedControls[i]);
1039 function getAlaCarteFormControls():FormControlModel[] {
1040 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1041 const vnfStoreKey: string = 'VF_vMee 0';
1042 const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830";
1043 const uuidData: Object = {
1044 modelId: "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
1045 modelName: "vf_vmee0..VfVmee..base_vmme..module-0",
1046 serviceId: "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
1048 vFModuleStoreKey: "vf_vmee0..VfVmee..base_vmme..module-0vmvzo",
1049 vnfStoreKey: "VF_vMee 0"
1051 const controls: FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vfModuleUUID, uuidData, true);
1055 test('getAlaCarteFormControls responce with wrong order of controls', () => {
1056 const controls:FormControlModel[] = getAlaCarteFormControls();
1058 const orderedControls : string[] = [
1059 FormControlNames.INSTANCE_NAME,
1060 FormControlNames.VOLUME_GROUP_NAME,
1061 FormControlNames.LCPCLOUD_REGION_ID,
1062 FormControlNames.TENANT_ID, // TENANT_ID must be after LEGACY_REGION
1063 FormControlNames.LEGACY_REGION,
1064 FormControlNames.ROLLBACK_ON_FAILURE,
1065 FormControlNames.SDN_C_PRE_LOAD
1068 for(let i = 0 ; i < orderedControls.length ; i++) {
1069 if (controls[i].controlName === 'legacyRegion') {
1070 expect(orderedControls[i]).toEqual('tenantId');
1075 test('getMacroFormControls should return the correct order of controls', () => {
1076 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
1077 const vnfStoreKey: string = 'VF_vMee 0';
1078 const vfModuleUUID: string = "522159d5-d6e0-4c2a-aa44-5a542a12a830";
1079 const uuidData: Object = {
1080 modelId : "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
1081 modelName : "vf_vmee0..VfVmee..base_vmme..module-0",
1082 serviceId : "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
1084 vFModuleStoreKey : "vf_vmee0..VfVmee..base_vmme..module-0vmvzo",
1085 vnfStoreKey : "VF_vMee 0"
1087 const controls: FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vfModuleUUID, uuidData, true);
1089 const orderedControls : string[] = [
1090 FormControlNames.INSTANCE_NAME,
1091 FormControlNames.VOLUME_GROUP_NAME
1094 for(let i = 0 ; i < orderedControls.length ; i++) {
1095 expect(controls[i].controlName).toEqual(orderedControls[i]);
1102 ${'volumeGroupName'}
1103 `('getAlacartFormControls $controllerName control validator shall have the expected regex', ({controllerName}) => {
1104 const controls:FormControlModel[] = getAlaCarteFormControls();
1106 const instanceNameControl: FormControlModel = <FormControlModel>controls.find(item => item.controlName == controllerName);
1107 const instanceNameValidator: ValidatorModel = instanceNameControl.validations.find(val => val.validatorName === ValidatorOptions.pattern);
1108 expect(instanceNameValidator.validatorArg).toEqual(/^[a-zA-Z0-9._-]*$/);
1111 test(' getAlaCarteFormControls gets null service', () => {
1112 const controls:FormControlModel[] = getAlaCarteFormControls();
1113 expect(controls.length).toEqual(7);
1115 const orderedControls : string[] = [
1116 FormControlNames.INSTANCE_NAME,
1117 FormControlNames.VOLUME_GROUP_NAME,
1118 FormControlNames.LCPCLOUD_REGION_ID,
1119 FormControlNames.LEGACY_REGION,
1120 FormControlNames.TENANT_ID,
1121 FormControlNames.ROLLBACK_ON_FAILURE,
1122 FormControlNames.SDN_C_PRE_LOAD
1125 for(let i = 0 ; i < orderedControls.length ; i++) {
1126 expect(controls[i].controlName).toEqual(orderedControls[i]);