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 {BasicControlGenerator} from "../basic.control.generator";
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 {Observable} from "rxjs";
17 import {SelectOption} from "../../../../models/selectOption";
18 import {FeatureFlagsService} from "../../../../services/featureFlag/feature-flags.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_SETTING_DEFAULTS_IN_DRAWING_BOARD": false,
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",
66 "gpb2_Internal2_mac": "00:11:22:EF:AC:DF",
67 "sctp-b-ipv6-egress_src_start_port": "0",
68 "sctp-a-ipv6-egress_rule_application": "any",
69 "Internal2_allow_transit": "true",
70 "sctp-b-IPv6_ethertype": "IPv6",
71 "sctp-a-egress_rule_application": "any",
72 "sctp-b-ingress_action": "pass",
73 "sctp-b-ingress_rule_protocol": "icmp",
74 "ncb2_Internal1_mac": "00:11:22:EF:AC:DF",
75 "sctp-b-ipv6-ingress-src_start_port": "0.0",
76 "ncb1_Internal2_mac": "00:11:22:EF:AC:DF",
77 "fsb_volume_size_0": "320.0",
78 "sctp-b-egress_src_addresses": "local",
79 "sctp-a-ipv6-ingress_ethertype": "IPv4",
80 "sctp-a-ipv6-ingress-dst_start_port": "0",
81 "sctp-b-ipv6-ingress_rule_application": "any",
82 "domain_name": "default-domain",
83 "sctp-a-ingress_rule_protocol": "icmp",
84 "sctp-b-egress-src_start_port": "0.0",
85 "sctp-a-egress_src_addresses": "local",
86 "sctp-b-display_name": "epc-sctp-b-ipv4v6-sec-group",
87 "sctp-a-egress-src_start_port": "0.0",
88 "sctp-a-ingress_ethertype": "IPv4",
89 "sctp-b-ipv6-ingress-dst_end_port": "65535",
90 "sctp-b-dst_subnet_prefix_v6": "::",
91 "nf_naming": "{ecomp_generated_naming=true}",
92 "sctp-a-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
93 "sctp-b-egress-dst_start_port": "0.0",
94 "ncb_flavor_name": "nv.c20r64d1",
95 "gpb1_Internal1_mac": "00:11:22:EF:AC:DF",
96 "sctp-b-egress_dst_subnet_prefix_len": "0.0",
97 "Internal2_net_cidr": "10.0.0.10",
98 "sctp-a-ingress-dst_start_port": "0.0",
99 "sctp-a-egress-dst_start_port": "0.0",
100 "fsb1_Internal2_mac": "00:11:22:EF:AC:DF",
101 "sctp-a-egress_ethertype": "IPv4",
102 "vlc_st_service_mode": "in-network-nat",
103 "sctp-a-ipv6-egress_ethertype": "IPv4",
104 "sctp-a-egress-src_end_port": "65535.0",
105 "sctp-b-ipv6-egress_rule_application": "any",
106 "sctp-b-egress_action": "pass",
107 "sctp-a-ingress-src_subnet_prefix_len": "0.0",
108 "sctp-b-ipv6-ingress-src_end_port": "65535.0",
109 "sctp-b-name": "epc-sctp-b-ipv4v6-sec-group",
110 "fsb2_Internal1_mac": "00:11:22:EF:AC:DF",
111 "sctp-a-ipv6-ingress-src_start_port": "0.0",
112 "sctp-b-ipv6-egress_ethertype": "IPv4",
113 "Internal1_net_cidr": "10.0.0.10",
114 "sctp-a-egress_dst_subnet_prefix": "0.0.0.0",
115 "fsb_flavor_name": "nv.c20r64d1",
116 "sctp_rule_protocol": "132",
117 "sctp-b-ipv6-ingress_src_subnet_prefix_len": "0",
118 "sctp-a-ipv6-ingress_rule_application": "any",
119 "ecomp_generated_naming": "false",
120 "sctp-a-IPv6_ethertype": "IPv6",
121 "vlc2_Internal1_mac": "00:11:22:EF:AC:DF",
122 "vlc_st_virtualization_type": "virtual-machine",
123 "sctp-b-ingress-dst_start_port": "0.0",
124 "sctp-b-ingress-dst_end_port": "65535.0",
125 "sctp-a-ipv6-ingress-src_end_port": "65535.0",
126 "sctp-a-display_name": "epc-sctp-a-ipv4v6-sec-group",
127 "sctp-b-ingress_rule_application": "any",
128 "int2_sec_group_name": "int2-sec-group",
129 "vlc_flavor_name": "nd.c16r64d1",
130 "sctp-b-ipv6-egress_src_addresses": "local",
131 "vlc_st_interface_type_int1": "other1",
132 "sctp-b-egress-src_end_port": "65535.0",
133 "sctp-a-ipv6-egress-dst_start_port": "0",
134 "vlc_st_interface_type_int2": "other2",
135 "sctp-a-ipv6-egress_rule_protocol": "any",
136 "Internal2_shared": "false",
137 "sctp-a-ipv6-egress_dst_subnet_prefix_len": "0",
138 "Internal2_rpf": "disable",
139 "vlc1_Internal1_mac": "00:11:22:EF:AC:DF",
140 "sctp-b-ipv6-egress_src_end_port": "65535",
141 "sctp-a-ipv6-egress_src_addresses": "local",
142 "sctp-a-ingress-dst_end_port": "65535.0",
143 "sctp-a-ipv6-egress_src_end_port": "65535",
144 "Internal1_forwarding_mode": "l2",
145 "Internal2_dhcp": "false",
146 "sctp-a-dst_subnet_prefix_v6": "::",
147 "pxe_image_name": "MME_PXE-Boot_16ACP04_GA.qcow2",
148 "vlc_st_interface_type_gtp": "other0",
149 "ncb1_Internal1_mac": "00:11:22:EF:AC:DF",
150 "sctp-b-src_subnet_prefix_v6": "::",
151 "sctp-a-egress_dst_subnet_prefix_len": "0.0",
152 "int1_sec_group_name": "int1-sec-group",
153 "Internal1_dhcp": "false",
154 "sctp-a-ipv6-egress_dst_end_port": "65535",
155 "Internal2_forwarding_mode": "l2",
156 "fsb2_Internal2_mac": "00:11:22:EF:AC:DF",
157 "sctp-b-egress_dst_subnet_prefix": "0.0.0.0",
158 "Internal1_net_cidr_len": "17",
159 "gpb2_Internal1_mac": "00:11:22:EF:AC:DF",
160 "sctp-b-ingress-src_subnet_prefix_len": "0.0",
161 "sctp-a-ingress_dst_addresses": "local",
162 "sctp-a-egress_action": "pass",
163 "fsb_volume_type_0": "SF-Default-SSD",
164 "ncb2_Internal2_mac": "00:11:22:EF:AC:DF",
165 "vlc_st_interface_type_sctp_a": "left",
166 "vlc_st_interface_type_sctp_b": "right",
167 "sctp-a-src_subnet_prefix_v6": "::",
168 "vlc_st_version": "2",
169 "sctp-b-egress_ethertype": "IPv4",
170 "sctp-a-ingress_rule_application": "any",
171 "gpb1_Internal2_mac": "00:11:22:EF:AC:DF",
172 "instance_ip_family_v6": "v6",
173 "sctp-a-ipv6-egress_src_start_port": "0",
174 "sctp-b-ingress-src_start_port": "0.0",
175 "sctp-b-ingress_dst_addresses": "local",
176 "fsb1_Internal1_mac": "00:11:22:EF:AC:DF",
177 "vlc_st_interface_type_oam": "management",
178 "multi_stage_design": "true",
179 "oam_sec_group_name": "oam-sec-group",
180 "Internal2_net_gateway": "10.0.0.10",
181 "sctp-a-ipv6-ingress-dst_end_port": "65535",
182 "sctp-b-ipv6-egress-dst_start_port": "0",
183 "Internal1_net_gateway": "10.0.0.10",
184 "sctp-b-ipv6-egress_rule_protocol": "any",
185 "gtp_sec_group_name": "gtp-sec-group",
186 "sctp-a-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
187 "sctp-b-ipv6-egress_dst_subnet_prefix_len": "0",
188 "sctp-a-ipv6-ingress_dst_addresses": "local",
189 "sctp-a-egress_rule_protocol": "icmp",
190 "sctp-b-ipv6-egress_action": "pass",
191 "sctp-a-ipv6-egress_action": "pass",
192 "Internal1_shared": "false",
193 "sctp-b-ipv6-ingress_rule_protocol": "any",
194 "Internal2_net_cidr_len": "17",
195 "sctp-a-name": "epc-sctp-a-ipv4v6-sec-group",
196 "sctp-a-ingress-src_end_port": "65535.0",
197 "sctp-b-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
198 "sctp-a-egress-dst_end_port": "65535.0",
199 "sctp-a-ingress_action": "pass",
200 "sctp-b-egress_rule_protocol": "icmp",
201 "sctp-b-ipv6-ingress_action": "pass",
202 "vlc_st_service_type": "firewall",
203 "sctp-b-ipv6-egress_dst_end_port": "65535",
204 "sctp-b-ipv6-ingress-dst_start_port": "0",
205 "vlc2_Internal2_mac": "00:11:22:EF:AC:DF",
206 "vlc_st_availability_zone": "true",
207 "fsb_volume_image_name_1": "MME_FSB2_16ACP04_GA.qcow2",
208 "sctp-b-ingress-src_subnet_prefix": "0.0.0.0",
209 "sctp-a-ipv6-ingress_src_subnet_prefix_len": "0",
210 "Internal1_allow_transit": "true",
211 "gpb_flavor_name": "nv.c20r64d1",
212 "availability_zone_max_count": "1",
213 "fsb_volume_image_name_0": "MME_FSB1_16ACP04_GA.qcow2",
214 "sctp-b-ipv6-ingress_dst_addresses": "local",
215 "sctp-b-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
216 "sctp-b-ipv6-ingress_ethertype": "IPv4",
217 "vlc1_Internal2_mac": "00:11:22:EF:AC:DF",
218 "sctp-a-ingress-src_subnet_prefix": "0.0.0.0",
219 "sctp-a-ipv6-ingress_action": "pass",
220 "Internal1_rpf": "disable",
221 "sctp-b-ingress_ethertype": "IPv4",
222 "sctp-b-egress_rule_application": "any",
223 "sctp-b-ingress-src_end_port": "65535.0",
224 "sctp-a-ipv6-ingress_rule_protocol": "any",
225 "sctp-a-ingress-src_start_port": "0.0",
226 "sctp-b-egress-dst_end_port": "65535.0"
229 "modelCustomizationName": "VF_vGeraldine 0",
231 "vf_vgeraldine0..VfVgeraldine..vflorence_vlc..module-1": {
232 "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
233 "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
234 "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
236 "name": "VfVgeraldine..vflorence_vlc..module-1",
238 "modelCustomizationName": "VfVgeraldine..vflorence_vlc..module-1",
240 "minCountInstances": 0,
241 "maxCountInstances": null,
243 "vfModuleLabel": "vflorence_vlc"
246 "volumeGroupAllowed": true
248 "vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2": {
249 "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
250 "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
251 "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
253 "name": "VfVgeraldine..vflorence_gpb..module-2",
255 "modelCustomizationName": "VfVgeraldine..vflorence_gpb..module-2",
257 "minCountInstances": 0,
258 "maxCountInstances": null,
260 "vfModuleLabel": "vflorence_gpb"
263 "volumeGroupAllowed": false
265 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
266 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
267 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
268 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
270 "name": "VfVgeraldine..base_vflorence..module-0",
272 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
274 "minCountInstances": 1,
275 "maxCountInstances": 1,
277 "vfModuleLabel": "base_vflorence"
280 "volumeGroupAllowed": true
284 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
285 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
286 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
287 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
289 "name": "VfVgeraldine..base_vflorence..module-0",
291 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
293 "minCountInstances": 1,
294 "maxCountInstances": 1,
296 "vfModuleLabel": "base_vflorence"
301 "vfcInstanceGroups": {}
306 "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986",
307 "invariantUuid": "379f816b-a7aa-422f-be30-17114ff50b7c",
308 "description": "ECOMP generic virtual link (network) base type for all other service-level and global networks",
311 "customizationUuid": "94fdd893-4a36-4d70-b16a-ec29c54c184f",
315 "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}}",
316 "exVL_naming": "{ecomp_generated_naming=true}",
317 "network_flows": "{is_network_policy=false, is_bound_to_vpn=false}",
318 "network_homing": "{ecomp_selected_instance_node_target=false}"
321 "modelCustomizationName": "ExtVL 0"
324 "collectionResources": {},
326 "Port Mirroring Configuration By Policy 0": {
327 "uuid": "b4398538-e89d-4f13-b33d-ca323434ba50",
328 "invariantUuid": "6ef0ca40-f366-4897-951f-abd65d25f6f7",
329 "description": "A port mirroring configuration by policy object",
330 "name": "Port Mirroring Configuration By Policy",
332 "customizationUuid": "3c3b7b8d-8669-4b3b-8664-61970041fad2",
336 "type": "Configuration",
337 "modelCustomizationName": "Port Mirroring Configuration By Policy 0",
339 "collectorNodes": null,
340 "configurationByPolicy": false
343 "serviceProxies": {},
345 "vf_vgeraldine0..VfVgeraldine..vflorence_vlc..module-1": {
346 "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
347 "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
348 "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
350 "name": "VfVgeraldine..vflorence_vlc..module-1",
352 "modelCustomizationName": "VfVgeraldine..vflorence_vlc..module-1",
354 "minCountInstances": 0,
355 "maxCountInstances": null,
357 "vfModuleLabel": "vflorence_vlc"
360 "volumeGroupAllowed": true
362 "vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2": {
363 "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
364 "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
365 "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
367 "name": "VfVgeraldine..vflorence_gpb..module-2",
369 "modelCustomizationName": "VfVgeraldine..vflorence_gpb..module-2",
371 "minCountInstances": 0,
372 "maxCountInstances": null,
374 "vfModuleLabel": "vflorence_gpb"
377 "volumeGroupAllowed": false
379 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
380 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
381 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
382 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
384 "name": "VfVgeraldine..base_vflorence..module-0",
386 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
388 "minCountInstances": 1,
389 "maxCountInstances": 1,
391 "vfModuleLabel": "base_vflorence"
394 "volumeGroupAllowed": true
398 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
399 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
400 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
401 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
403 "name": "VfVgeraldine..base_vflorence..module-0",
405 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0",
407 "minCountInstances": 1,
408 "maxCountInstances": 1,
410 "vfModuleLabel": "base_vflorence"
419 "6e59c5de-f052-46fa-aa7e-2fca9d674c44": {
422 "rollbackOnFailure": "true",
424 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0": {
425 "vf_vgeraldine0..VfVgeraldine..base_vflorence..module-0vmvzo": {
426 "isMissingData": false,
427 "sdncPreReload": null,
429 "modelType": "VFmodule",
430 "modelInvariantId": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
431 "modelVersionId": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
432 "modelName": "VfVgeraldine..base_vflorence..module-0",
434 "modelCustomizationId": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
435 "modelCustomizationName": "VfVgeraldine..base_vflorence..module-0"
440 "trackById": "wmtm6sy2uj"
444 "isMissingData": true,
445 "originalName": "VF_vGeraldine 0",
446 "vnfStoreKey": "VF_vGeraldine 0",
447 "trackById": "p3wk448m5do",
448 "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60",
449 "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
450 "lcpCloudRegionId": null,
452 "lineOfBusiness": null,
453 "platformName": null,
456 "modelInvariantId": "4160458e-f648-4b30-a176-43881ffffe9e",
457 "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
458 "modelName": "VF_vGeraldine",
459 "modelVersion": "2.0",
460 "modelCustomizationName": "VF_vGeraldine 0"
467 "validationCounter": 1,
469 "existingVNFCounterMap": {
470 "d6557200-ecf2-4641-8094-5393ae3aae60": 1
472 "globalSubscriberId": "e433710f-9217-458d-a79d-1c7aff376d89",
473 "subscriptionServiceType": "TYLER SILVIA",
474 "owningEntityId": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
475 "productFamilyId": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
476 "lcpCloudRegionId": "hvf6",
477 "tenantId": "229bcdc6eaeb4ca59d55221141d01f8e",
480 "rollbackOnFailure": "true",
483 "modelInvariantId": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
484 "modelVersionId": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
485 "modelName": "ComplexService",
486 "modelVersion": "1.0",
487 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44"
490 "name": "ComplexService",
492 "description": "ComplexService",
493 "category": "Emanuel",
494 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
495 "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
498 "isMultiStepDesign": false
501 "lcpRegionsAndTenants": {
514 "lcpRegionsTenantsMap": {
517 "id": "092eb9e8e4b7412e8787dd091bc58e86",
518 "name": "USP-SIP-IC-24335-T-01",
524 "id": "bae71557c5bb4d5aac6743a4e5f1d054",
525 "name": "AIN Web Tool-15-D-testalexandria",
529 "id": "d0a3e3f2964542259d155a81c41aadc3",
530 "name": "test-hvf6-09",
534 "id": "fa45ca53c80b492fa8be5477cd84fc2b",
539 "id": "cbb99fe4ada84631b7baf046b6fd2044",
540 "name": "DN5242-Nov16-T3",
548 "id": "ebc3bc3d-62fd-4a3f-a037-f619df4ff034",
553 "id": "17cc1042-527b-11e6-beb8-9e71128cae77",
558 "id": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
563 "id": "a4f6f2ae-9bf5-4ed7-b904-06b2099c4bd7",
564 "name": "Enhanced Services",
573 "id": "323d69d9-2efe-4r45-ay0a-89ea7ard4e6f",
574 "name": "vEsmeralda",
578 "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
583 "id": "d8a6ed93-251c-47ca-adc9-86671fd19f4c",
588 "id": "db171b8f-115c-4992-a2e3-ee04cae357e0",
608 "id": "e433710f-9217-458d-a79d-1c7aff376d89",
609 "name": "TYLER SILVIA",
613 "id": "b6a3f28c-eebf-494c-a900-055cc7c874ce",
623 "id": "0ee8c1bc-7cbd-4b0a-a1ac-e9999255abc1",
624 "name": "CARA Griffin",
628 "id": "c7611ebe-c324-48f1-8085-94aef0c6ef3d",
629 "name": "DARREN MCGEE",
633 "id": "e30755dc-5673-4b6b-9dcf-9abdd96b93d1",
639 "name": "vSalvatore",
643 "id": "d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4",
653 "id": "12a96a9d-4b4c-4349-a950-fe1159602621",
654 "name": "DARREN MCGEE",
659 "e433710f-9217-458d-a79d-1c7aff376d89": [
662 "name": "vRichardson",
667 "name": "TYLER SILVIA",
682 "name": "vVoiceMail",
717 "name": "vEsmeralda",
747 "name": "JOHANNA_SANTOS",
760 "name": "NFTJSSSS-NFT1"
764 "name": "YUDFJULP-JAG1"
768 "name": "UUUAIAAI-YYY1"
772 "name": "AVTRFLHD-AVT1"
776 "name": "ATLSANAI-ATL34"
779 "categoryParameters": {
780 "owningEntityList": [
786 "id": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
787 "name": "WayneHolland"
808 "lineOfBusinessList": [
829 "type": "[LCP_REGIONS_AND_TENANTS] Update",
833 "name": "CAR_2020_ER",
837 "id": "21014aa2-526b-11e6-beb8-9e71128cae77",
838 "name": "JULIO ERICKSON",
842 "id": "DHV1707-TestSubscriber-2",
843 "name": "DALE BRIDGES",
847 "id": "DHV1707-TestSubscriber-1",
848 "name": "LLOYD BRIDGES",
852 "id": "jimmy-example",
853 "name": "JimmyExampleCust-20161102",
857 "id": "jimmy-example2",
858 "name": "JimmyExampleCust-20161103",
862 "id": "ERICA5779-TestSub-PWT-102",
863 "name": "ERICA5779-TestSub-PWT-102",
867 "id": "ERICA5779-TestSub-PWT-101",
868 "name": "ERICA5779-TestSub-PWT-101",
872 "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
877 "id": "ERICA5779-Subscriber-4",
878 "name": "ERICA5779-Subscriber-5",
882 "id": "ERICA5779-TestSub-PWT-103",
883 "name": "ERICA5779-TestSub-PWT-103",
887 "id": "ERICA5779-Subscriber-2",
888 "name": "ERICA5779-Subscriber-2",
892 "id": "e433710f-9217-458d-a79d-1c7aff376d89",
893 "name": "SILVIA ROBBINS",
897 "id": "ERICA5779-Subscriber-3",
898 "name": "ERICA5779-Subscriber-3",
902 "id": "31739f3e-526b-11e6-beb8-9e71128cae77",
903 "name": "CRAIG/ROBERTS",
912 class MockFeatureFlagsService {}
914 describe('VNF Control Generator', () => {
916 let service: VnfControlGenerator;
917 let httpMock: HttpTestingController;
920 beforeAll(done => (async () => {
921 TestBed.configureTestingModule({
922 imports: [HttpClientTestingModule],
923 providers: [VnfControlGenerator,
925 BasicControlGenerator,
929 {provide:FeatureFlagsService, useClass: MockFeatureFlagsService},
930 {provide: NgRedux, useClass: MockAppStore}]
932 await TestBed.compileComponents();
935 injector = getTestBed();
936 service = injector.get(VnfControlGenerator);
937 httpMock = injector.get(HttpTestingController);
939 })().then(done).catch(done.fail));
942 test('getMacroFormControls check for mandatory controls', () => {
943 const serviceId : string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
944 const vnfName : string = "VF_vGeraldine 0";
945 const vnfStoreKey : string = "VF_vGeraldine 0";
946 const controls :FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfName, []);
948 const mandatoryControls : string[] = [
949 FormControlNames.INSTANCE_NAME,
950 FormControlNames.LCPCLOUD_REGION_ID,
951 FormControlNames.TENANT_ID,
955 for(let i = 0 ; i < mandatoryControls.length ; i++){
956 let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required');
957 expect(requiredExist).toBeDefined();
961 test('should provide empty array on getMacroFormControls when serviceId, vnfName and vnfStoreKey equals to null', () => {
963 let vnfStoreKey = null;
964 const serviceId = null;
965 const vnfName : string = null;
966 const result:FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfName, []);
967 expect(result).toEqual([]);
970 test('should provide empty array on getAlaCarteFormControls when serviceId, vnfName and vnfStoreKey equals to null', () => {
971 let vnfStoreKey = null;
972 const serviceId = null;
973 const vnfName : string = null;
974 const result:FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vnfName, []);
975 expect(result).toEqual([]);
978 function getALaCarteFormControls(vnfStoreKey: string): FormControlModel[] {
979 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
980 const vnfName: string = "VF_vGeraldine 0";
981 const controls: FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vnfName, []);
985 test('getMacroFormControls should return the correct order of controls', () => {
986 const serviceId : string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
987 const vnfName : string = "VF_vGeraldine 0";
988 const vnfStoreKey : string = null;
989 const controls :FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfName, []);
991 const controlsOrderNames = [
992 FormControlNames.INSTANCE_NAME,
993 FormControlNames.PRODUCT_FAMILY_ID,
994 FormControlNames.LCPCLOUD_REGION_ID ,
1000 expect(controls.length).toEqual(7);
1001 for(let i = 0 ; i < controls.length ; i++){
1002 expect(controls[i].controlName).toEqual(controlsOrderNames[i]);
1006 test('getAlacartFormControls should return the correct order of controls', () => {
1007 const controls = getALaCarteFormControls(null);
1009 const controlsOrderNames = [
1010 FormControlNames.INSTANCE_NAME,
1011 FormControlNames.PRODUCT_FAMILY_ID,
1012 FormControlNames.LCPCLOUD_REGION_ID,
1017 'rollbackOnFailure'];
1018 expect(controls.length).toEqual(8);
1019 for(let i = 0 ; i < controls.length ; i++) {
1020 expect(controls[i].controlName).toEqual(controlsOrderNames[i]);
1025 test('getAlacartFormControls check for mandatory controls', () => {
1026 const controls = getALaCarteFormControls("VF_vGeraldine 0");
1027 const mandatoryControls : string[] = [
1028 FormControlNames.INSTANCE_NAME,
1029 FormControlNames.LCPCLOUD_REGION_ID,
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('getAlacartFormControls instance name control validator shall have the expected regex', () => {
1042 const controls:FormControlModel[] = getALaCarteFormControls("VF_vGeraldine 0");
1044 const instanceNameControl: FormControlModel = <FormControlModel>controls.find(item => item.controlName === FormControlNames.INSTANCE_NAME);
1045 const instanceNameValidator: ValidatorModel = instanceNameControl.validations.find(val => val.validatorName === ValidatorOptions.pattern);
1046 expect(instanceNameValidator.validatorArg).toEqual(/^[a-zA-Z0-9._-]*$/);
1049 test('rollback should return observable of true, false', () => {
1050 let result : Observable<SelectOption[]> = service.getRollBackOnFailureOptions();
1051 result.subscribe((val)=>{
1052 expect(val).toEqual([
1053 new SelectOption({id: 'true', name: 'Rollback'}),
1054 new SelectOption({id: 'false', name: 'Don\'t Rollback'})