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_UNASSIGN_SERVICE": true,
30 "FLAG_SHOW_VERIFY_SERVICE": false,
31 "FLAG_COLLECTION_RESOURCE_SUPPORT": true,
32 "FLAG_DUPLICATE_VNF": true,
33 "FLAG_SERVICE_MODEL_CACHE": true,
34 "CREATE_INSTANCE_TEST": false,
35 "FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD": false,
36 "FLAG_ASYNC_INSTANTIATION": true,
37 "FLAG_ASYNC_JOBS": true,
38 "EMPTY_DRAWING_BOARD_TEST": false,
39 "FLAG_ADD_MSO_TESTAPI_FIELD": true
41 "type": "[FLAGS] Update"
45 "6e59c5de-f052-46fa-aa7e-2fca9d674c44": {
47 "uuid": "6e59c5de-f052-46fa-aa7e-2fca9d674c44",
48 "invariantUuid": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
49 "name": "ComplexService",
51 "toscaModelURL": null,
52 "category": "Emanuel",
55 "description": "ComplexService",
56 "serviceEcompNaming": "false",
57 "instantiationType": "Macro",
62 "uuid": "d6557200-ecf2-4641-8094-5393ae3aae60",
63 "invariantUuid": "4160458e-f648-4b30-a176-43881ffffe9e",
64 "description": "VSP_vMee",
67 "customizationUuid": "91415b44-753d-494c-926a-456a9172bbb9",
73 "gpb2_Internal2_mac": "00:11:22:EF:AC:DF",
74 "sctp-b-ipv6-egress_src_start_port": "0",
75 "sctp-a-ipv6-egress_rule_application": "any",
76 "Internal2_allow_transit": "true",
77 "sctp-b-IPv6_ethertype": "IPv6",
78 "sctp-a-egress_rule_application": "any",
79 "sctp-b-ingress_action": "pass",
80 "sctp-b-ingress_rule_protocol": "icmp",
81 "ncb2_Internal1_mac": "00:11:22:EF:AC:DF",
82 "sctp-b-ipv6-ingress-src_start_port": "0.0",
83 "ncb1_Internal2_mac": "00:11:22:EF:AC:DF",
84 "fsb_volume_size_0": "320.0",
85 "sctp-b-egress_src_addresses": "local",
86 "sctp-a-ipv6-ingress_ethertype": "IPv4",
87 "sctp-a-ipv6-ingress-dst_start_port": "0",
88 "sctp-b-ipv6-ingress_rule_application": "any",
89 "domain_name": "default-domain",
90 "sctp-a-ingress_rule_protocol": "icmp",
91 "sctp-b-egress-src_start_port": "0.0",
92 "sctp-a-egress_src_addresses": "local",
93 "sctp-b-display_name": "epc-sctp-b-ipv4v6-sec-group",
94 "sctp-a-egress-src_start_port": "0.0",
95 "sctp-a-ingress_ethertype": "IPv4",
96 "sctp-b-ipv6-ingress-dst_end_port": "65535",
97 "sctp-b-dst_subnet_prefix_v6": "::",
98 "nf_naming": "{ecomp_generated_naming=true}",
99 "sctp-a-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
100 "sctp-b-egress-dst_start_port": "0.0",
101 "ncb_flavor_name": "nv.c20r64d1",
102 "gpb1_Internal1_mac": "00:11:22:EF:AC:DF",
103 "sctp-b-egress_dst_subnet_prefix_len": "0.0",
104 "Internal2_net_cidr": "10.0.0.10",
105 "sctp-a-ingress-dst_start_port": "0.0",
106 "sctp-a-egress-dst_start_port": "0.0",
107 "fsb1_Internal2_mac": "00:11:22:EF:AC:DF",
108 "sctp-a-egress_ethertype": "IPv4",
109 "vlc_st_service_mode": "in-network-nat",
110 "sctp-a-ipv6-egress_ethertype": "IPv4",
111 "sctp-a-egress-src_end_port": "65535.0",
112 "sctp-b-ipv6-egress_rule_application": "any",
113 "sctp-b-egress_action": "pass",
114 "sctp-a-ingress-src_subnet_prefix_len": "0.0",
115 "sctp-b-ipv6-ingress-src_end_port": "65535.0",
116 "sctp-b-name": "epc-sctp-b-ipv4v6-sec-group",
117 "fsb2_Internal1_mac": "00:11:22:EF:AC:DF",
118 "sctp-a-ipv6-ingress-src_start_port": "0.0",
119 "sctp-b-ipv6-egress_ethertype": "IPv4",
120 "Internal1_net_cidr": "10.0.0.10",
121 "sctp-a-egress_dst_subnet_prefix": "0.0.0.0",
122 "fsb_flavor_name": "nv.c20r64d1",
123 "sctp_rule_protocol": "132",
124 "sctp-b-ipv6-ingress_src_subnet_prefix_len": "0",
125 "sctp-a-ipv6-ingress_rule_application": "any",
126 "ecomp_generated_naming": "false",
127 "sctp-a-IPv6_ethertype": "IPv6",
128 "vlc2_Internal1_mac": "00:11:22:EF:AC:DF",
129 "vlc_st_virtualization_type": "virtual-machine",
130 "sctp-b-ingress-dst_start_port": "0.0",
131 "sctp-b-ingress-dst_end_port": "65535.0",
132 "sctp-a-ipv6-ingress-src_end_port": "65535.0",
133 "sctp-a-display_name": "epc-sctp-a-ipv4v6-sec-group",
134 "sctp-b-ingress_rule_application": "any",
135 "int2_sec_group_name": "int2-sec-group",
136 "vlc_flavor_name": "nd.c16r64d1",
137 "sctp-b-ipv6-egress_src_addresses": "local",
138 "vlc_st_interface_type_int1": "other1",
139 "sctp-b-egress-src_end_port": "65535.0",
140 "sctp-a-ipv6-egress-dst_start_port": "0",
141 "vlc_st_interface_type_int2": "other2",
142 "sctp-a-ipv6-egress_rule_protocol": "any",
143 "Internal2_shared": "false",
144 "sctp-a-ipv6-egress_dst_subnet_prefix_len": "0",
145 "Internal2_rpf": "disable",
146 "vlc1_Internal1_mac": "00:11:22:EF:AC:DF",
147 "sctp-b-ipv6-egress_src_end_port": "65535",
148 "sctp-a-ipv6-egress_src_addresses": "local",
149 "sctp-a-ingress-dst_end_port": "65535.0",
150 "sctp-a-ipv6-egress_src_end_port": "65535",
151 "Internal1_forwarding_mode": "l2",
152 "Internal2_dhcp": "false",
153 "sctp-a-dst_subnet_prefix_v6": "::",
154 "pxe_image_name": "MME_PXE-Boot_16ACP04_GA.qcow2",
155 "vlc_st_interface_type_gtp": "other0",
156 "ncb1_Internal1_mac": "00:11:22:EF:AC:DF",
157 "sctp-b-src_subnet_prefix_v6": "::",
158 "sctp-a-egress_dst_subnet_prefix_len": "0.0",
159 "int1_sec_group_name": "int1-sec-group",
160 "Internal1_dhcp": "false",
161 "sctp-a-ipv6-egress_dst_end_port": "65535",
162 "Internal2_forwarding_mode": "l2",
163 "fsb2_Internal2_mac": "00:11:22:EF:AC:DF",
164 "sctp-b-egress_dst_subnet_prefix": "0.0.0.0",
165 "Internal1_net_cidr_len": "17",
166 "gpb2_Internal1_mac": "00:11:22:EF:AC:DF",
167 "sctp-b-ingress-src_subnet_prefix_len": "0.0",
168 "sctp-a-ingress_dst_addresses": "local",
169 "sctp-a-egress_action": "pass",
170 "fsb_volume_type_0": "SF-Default-SSD",
171 "ncb2_Internal2_mac": "00:11:22:EF:AC:DF",
172 "vlc_st_interface_type_sctp_a": "left",
173 "vlc_st_interface_type_sctp_b": "right",
174 "sctp-a-src_subnet_prefix_v6": "::",
175 "vlc_st_version": "2",
176 "sctp-b-egress_ethertype": "IPv4",
177 "sctp-a-ingress_rule_application": "any",
178 "gpb1_Internal2_mac": "00:11:22:EF:AC:DF",
179 "instance_ip_family_v6": "v6",
180 "sctp-a-ipv6-egress_src_start_port": "0",
181 "sctp-b-ingress-src_start_port": "0.0",
182 "sctp-b-ingress_dst_addresses": "local",
183 "fsb1_Internal1_mac": "00:11:22:EF:AC:DF",
184 "vlc_st_interface_type_oam": "management",
185 "multi_stage_design": "true",
186 "oam_sec_group_name": "oam-sec-group",
187 "Internal2_net_gateway": "10.0.0.10",
188 "sctp-a-ipv6-ingress-dst_end_port": "65535",
189 "sctp-b-ipv6-egress-dst_start_port": "0",
190 "Internal1_net_gateway": "10.0.0.10",
191 "sctp-b-ipv6-egress_rule_protocol": "any",
192 "gtp_sec_group_name": "gtp-sec-group",
193 "sctp-a-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
194 "sctp-b-ipv6-egress_dst_subnet_prefix_len": "0",
195 "sctp-a-ipv6-ingress_dst_addresses": "local",
196 "sctp-a-egress_rule_protocol": "icmp",
197 "sctp-b-ipv6-egress_action": "pass",
198 "sctp-a-ipv6-egress_action": "pass",
199 "Internal1_shared": "false",
200 "sctp-b-ipv6-ingress_rule_protocol": "any",
201 "Internal2_net_cidr_len": "17",
202 "sctp-a-name": "epc-sctp-a-ipv4v6-sec-group",
203 "sctp-a-ingress-src_end_port": "65535.0",
204 "sctp-b-ipv6-ingress_src_subnet_prefix": "0.0.0.0",
205 "sctp-a-egress-dst_end_port": "65535.0",
206 "sctp-a-ingress_action": "pass",
207 "sctp-b-egress_rule_protocol": "icmp",
208 "sctp-b-ipv6-ingress_action": "pass",
209 "vlc_st_service_type": "firewall",
210 "sctp-b-ipv6-egress_dst_end_port": "65535",
211 "sctp-b-ipv6-ingress-dst_start_port": "0",
212 "vlc2_Internal2_mac": "00:11:22:EF:AC:DF",
213 "vlc_st_availability_zone": "true",
214 "fsb_volume_image_name_1": "MME_FSB2_16ACP04_GA.qcow2",
215 "sctp-b-ingress-src_subnet_prefix": "0.0.0.0",
216 "sctp-a-ipv6-ingress_src_subnet_prefix_len": "0",
217 "Internal1_allow_transit": "true",
218 "gpb_flavor_name": "nv.c20r64d1",
219 "availability_zone_max_count": "1",
220 "fsb_volume_image_name_0": "MME_FSB1_16ACP04_GA.qcow2",
221 "sctp-b-ipv6-ingress_dst_addresses": "local",
222 "sctp-b-ipv6-egress_dst_subnet_prefix": "0.0.0.0",
223 "sctp-b-ipv6-ingress_ethertype": "IPv4",
224 "vlc1_Internal2_mac": "00:11:22:EF:AC:DF",
225 "sctp-a-ingress-src_subnet_prefix": "0.0.0.0",
226 "sctp-a-ipv6-ingress_action": "pass",
227 "Internal1_rpf": "disable",
228 "sctp-b-ingress_ethertype": "IPv4",
229 "sctp-b-egress_rule_application": "any",
230 "sctp-b-ingress-src_end_port": "65535.0",
231 "sctp-a-ipv6-ingress_rule_protocol": "any",
232 "sctp-a-ingress-src_start_port": "0.0",
233 "sctp-b-egress-dst_end_port": "65535.0"
236 "modelCustomizationName": "VF_vMee 0",
238 "vf_vmee0..VfVmee..vmme_vlc..module-1": {
239 "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
240 "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
241 "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
243 "name": "VfVmee..vmme_vlc..module-1",
245 "modelCustomizationName": "VfVmee..vmme_vlc..module-1",
247 "minCountInstances": 0,
248 "maxCountInstances": null,
250 "vfModuleLabel": "vmme_vlc"
253 "volumeGroupAllowed": true
255 "vf_vmee0..VfVmee..vmme_gpb..module-2": {
256 "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
257 "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
258 "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
260 "name": "VfVmee..vmme_gpb..module-2",
262 "modelCustomizationName": "VfVmee..vmme_gpb..module-2",
264 "minCountInstances": 0,
265 "maxCountInstances": null,
267 "vfModuleLabel": "vmme_gpb"
270 "volumeGroupAllowed": false
272 "vf_vmee0..VfVmee..base_vmme..module-0": {
273 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
274 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
275 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
277 "name": "VfVmee..base_vmme..module-0",
279 "modelCustomizationName": "VfVmee..base_vmme..module-0",
281 "minCountInstances": 1,
282 "maxCountInstances": 1,
284 "vfModuleLabel": "base_vmme"
287 "volumeGroupAllowed": true
291 "vf_vmee0..VfVmee..base_vmme..module-0": {
292 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
293 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
294 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
296 "name": "VfVmee..base_vmme..module-0",
298 "modelCustomizationName": "VfVmee..base_vmme..module-0",
300 "minCountInstances": 1,
301 "maxCountInstances": 1,
303 "vfModuleLabel": "base_vmme"
308 "vfcInstanceGroups": {}
313 "uuid": "ddc3f20c-08b5-40fd-af72-c6d14636b986",
314 "invariantUuid": "379f816b-a7aa-422f-be30-17114ff50b7c",
315 "description": "ECOMP generic virtual link (network) base type for all other service-level and global networks",
318 "customizationUuid": "94fdd893-4a36-4d70-b16a-ec29c54c184f",
322 "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}}",
323 "exVL_naming": "{ecomp_generated_naming=true}",
324 "network_flows": "{is_network_policy=false, is_bound_to_vpn=false}",
325 "network_homing": "{ecomp_selected_instance_node_target=false}"
328 "modelCustomizationName": "ExtVL 0"
331 "collectionResource": {},
333 "Port Mirroring Configuration By Policy 0": {
334 "uuid": "b4398538-e89d-4f13-b33d-ca323434ba50",
335 "invariantUuid": "6ef0ca40-f366-4897-951f-abd65d25f6f7",
336 "description": "A port mirroring configuration by policy object",
337 "name": "Port Mirroring Configuration By Policy",
339 "customizationUuid": "3c3b7b8d-8669-4b3b-8664-61970041fad2",
343 "type": "Configuration",
344 "modelCustomizationName": "Port Mirroring Configuration By Policy 0",
346 "collectorNodes": null,
347 "configurationByPolicy": false
350 "serviceProxies": {},
352 "vf_vmee0..VfVmee..vmme_vlc..module-1": {
353 "uuid": "522159d5-d6e0-4c2a-aa44-5a542a12a830",
354 "invariantUuid": "98a7c88b-b577-476a-90e4-e25a5871e02b",
355 "customizationUuid": "55b1be94-671a-403e-a26c-667e9c47d091",
357 "name": "VfVmee..vmme_vlc..module-1",
359 "modelCustomizationName": "VfVmee..vmme_vlc..module-1",
361 "minCountInstances": 0,
362 "maxCountInstances": null,
364 "vfModuleLabel": "vmme_vlc"
367 "volumeGroupAllowed": true
369 "vf_vmee0..VfVmee..vmme_gpb..module-2": {
370 "uuid": "41708296-e443-4c71-953f-d9a010f059e1",
371 "invariantUuid": "1cca90b8-3490-495e-87da-3f3e4c57d5b9",
372 "customizationUuid": "6add59e0-7fe1-4bc4-af48-f8812422ae7c",
374 "name": "VfVmee..vmme_gpb..module-2",
376 "modelCustomizationName": "VfVmee..vmme_gpb..module-2",
378 "minCountInstances": 0,
379 "maxCountInstances": null,
381 "vfModuleLabel": "vmme_gpb"
384 "volumeGroupAllowed": false
386 "vf_vmee0..VfVmee..base_vmme..module-0": {
387 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
388 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
389 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
391 "name": "VfVmee..base_vmme..module-0",
393 "modelCustomizationName": "VfVmee..base_vmme..module-0",
395 "minCountInstances": 1,
396 "maxCountInstances": 1,
398 "vfModuleLabel": "base_vmme"
401 "volumeGroupAllowed": true
405 "vf_vmee0..VfVmee..base_vmme..module-0": {
406 "uuid": "a27f5cfc-7f12-4f99-af08-0af9c3885c87",
407 "invariantUuid": "a6f9e51a-2b35-416a-ae15-15e58d61f36d",
408 "customizationUuid": "f8c040f1-7e51-4a11-aca8-acf256cfd861",
410 "name": "VfVmee..base_vmme..module-0",
412 "modelCustomizationName": "VfVmee..base_vmme..module-0",
414 "minCountInstances": 1,
415 "maxCountInstances": 1,
417 "vfModuleLabel": "base_vmme"
426 "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 "isMultiStepDesign": false
508 "lcpRegionsAndTenants": {
521 "lcpRegionsTenantsMap": {
524 "id": "092eb9e8e4b7412e8787dd091bc58e86",
525 "name": "USP-SIP-IC-24335-T-01",
531 "id": "bae71557c5bb4d5aac6743a4e5f1d054",
532 "name": "AIN Web Tool-15-D-testalexandria",
536 "id": "d0a3e3f2964542259d155a81c41aadc3",
537 "name": "test-hvf6-09",
541 "id": "fa45ca53c80b492fa8be5477cd84fc2b",
546 "id": "cbb99fe4ada84631b7baf046b6fd2044",
547 "name": "DN5242-Nov16-T3",
555 "id": "ebc3bc3d-62fd-4a3f-a037-f619df4ff034",
560 "id": "17cc1042-527b-11e6-beb8-9e71128cae77",
565 "id": "36b4733a-53f4-4cc8-8ff0-9172e5fc4b8e",
570 "id": "a4f6f2ae-9bf5-4ed7-b904-06b2099c4bd7",
571 "name": "Enhanced Services",
580 "id": "323d69d9-2efe-4r45-ay0a-89ea7ard4e6f",
585 "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
590 "id": "d8a6ed93-251c-47ca-adc9-86671fd19f4c",
595 "id": "db171b8f-115c-4992-a2e3-ee04cae357e0",
615 "id": "e433710f-9217-458d-a79d-1c7aff376d89",
616 "name": "TYLER SILVIA",
620 "id": "b6a3f28c-eebf-494c-a900-055cc7c874ce",
630 "id": "0ee8c1bc-7cbd-4b0a-a1ac-e9999255abc1",
631 "name": "CARA Griffin",
635 "id": "c7611ebe-c324-48f1-8085-94aef0c6ef3d",
636 "name": "DARREN MCGEE",
640 "id": "e30755dc-5673-4b6b-9dcf-9abdd96b93d1",
646 "name": "vSalvatore",
650 "id": "d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4",
660 "id": "12a96a9d-4b4c-4349-a950-fe1159602621",
661 "name": "DARREN MCGEE",
666 "e433710f-9217-458d-a79d-1c7aff376d89": [
669 "name": "vRichardson",
674 "name": "TYLER SILVIA",
689 "name": "vVoiceMail",
754 "name": "JOHANNA_SANTOS",
767 "name": "NFTJSSSS-NFT1"
771 "name": "YUDFJULP-JAG1"
775 "name": "UUUAIAAI-YYY1"
779 "name": "AVTRFLHD-AVT1"
783 "name": "ATLSANAI-ATL34"
786 "categoryParameters": {
787 "owningEntityList": [
793 "id": "d61e6f2d-12fa-4cc2-91df-7c244011d6fc",
794 "name": "WayneHolland"
815 "lineOfBusinessList": [
836 "type": "[LCP_REGIONS_AND_TENANTS] Update",
840 "name": "CAR_2020_ER",
844 "id": "21014aa2-526b-11e6-beb8-9e71128cae77",
845 "name": "JULIO ERICKSON",
849 "id": "DHV1707-TestSubscriber-2",
850 "name": "DALE BRIDGES",
854 "id": "DHV1707-TestSubscriber-1",
855 "name": "LLOYD BRIDGES",
859 "id": "jimmy-example",
860 "name": "JimmyExampleCust-20161102",
864 "id": "jimmy-example2",
865 "name": "JimmyExampleCust-20161103",
869 "id": "ERICA5779-TestSub-PWT-102",
870 "name": "ERICA5779-TestSub-PWT-102",
874 "id": "ERICA5779-TestSub-PWT-101",
875 "name": "ERICA5779-TestSub-PWT-101",
879 "id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb",
884 "id": "ERICA5779-Subscriber-4",
885 "name": "ERICA5779-Subscriber-5",
889 "id": "ERICA5779-TestSub-PWT-103",
890 "name": "ERICA5779-TestSub-PWT-103",
894 "id": "ERICA5779-Subscriber-2",
895 "name": "ERICA5779-Subscriber-2",
899 "id": "e433710f-9217-458d-a79d-1c7aff376d89",
900 "name": "SILVIA ROBBINS",
904 "id": "ERICA5779-Subscriber-3",
905 "name": "ERICA5779-Subscriber-3",
909 "id": "31739f3e-526b-11e6-beb8-9e71128cae77",
910 "name": "CRAIG/ROBERTS",
919 class MockFeatureFlagsService {}
921 describe('VNF Control Generator', () => {
923 let service: VnfControlGenerator;
924 let httpMock: HttpTestingController;
927 beforeAll(done => (async () => {
928 TestBed.configureTestingModule({
929 imports: [HttpClientTestingModule],
930 providers: [VnfControlGenerator,
932 BasicControlGenerator,
936 {provide:FeatureFlagsService, useClass: MockFeatureFlagsService},
937 {provide: NgRedux, useClass: MockAppStore}]
939 await TestBed.compileComponents();
942 injector = getTestBed();
943 service = injector.get(VnfControlGenerator);
944 httpMock = injector.get(HttpTestingController);
946 })().then(done).catch(done.fail));
949 test('getMacroFormControls check for mandatory controls', () => {
950 const serviceId : string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
951 const vnfName : string = "VF_vMee 0";
952 const vnfStoreKey : string = "VF_vMee 0";
953 const controls :FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfName, []);
955 const mandatoryControls : string[] = [
956 FormControlNames.INSTANCE_NAME,
957 FormControlNames.LCPCLOUD_REGION_ID,
958 FormControlNames.TENANT_ID,
962 for(let i = 0 ; i < mandatoryControls.length ; i++){
963 let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required');
964 expect(requiredExist).toBeDefined();
968 test('should provide empty array on getMacroFormControls when serviceId, vnfName and vnfStoreKey equals to null', () => {
970 let vnfStoreKey = null;
971 const serviceId = null;
972 const vnfName : string = null;
973 const result:FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfName, []);
974 expect(result).toEqual([]);
977 test('should provide empty array on getAlaCarteFormControls 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.getAlaCarteFormControls(serviceId, vnfStoreKey, vnfName, []);
982 expect(result).toEqual([]);
985 function getALaCarteFormControls(vnfStoreKey: string): FormControlModel[] {
986 const serviceId: string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
987 const vnfName: string = "VF_vMee 0";
988 const controls: FormControlModel[] = service.getAlaCarteFormControls(serviceId, vnfStoreKey, vnfName, []);
992 test('getMacroFormControls should return the correct order of controls', () => {
993 const serviceId : string = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
994 const vnfName : string = "VF_vMee 0";
995 const vnfStoreKey : string = null;
996 const controls :FormControlModel[] = service.getMacroFormControls(serviceId, vnfStoreKey, vnfName, []);
998 const controlsOrderNames = [
999 FormControlNames.INSTANCE_NAME,
1000 FormControlNames.PRODUCT_FAMILY_ID,
1001 FormControlNames.LCPCLOUD_REGION_ID ,
1007 expect(controls.length).toEqual(7);
1008 for(let i = 0 ; i < controls.length ; i++){
1009 expect(controls[i].controlName).toEqual(controlsOrderNames[i]);
1013 test('getAlacartFormControls should return the correct order of controls', () => {
1014 const controls = getALaCarteFormControls(null);
1016 const controlsOrderNames = [
1017 FormControlNames.INSTANCE_NAME,
1018 FormControlNames.PRODUCT_FAMILY_ID,
1019 FormControlNames.LCPCLOUD_REGION_ID,
1024 'rollbackOnFailure'];
1025 expect(controls.length).toEqual(8);
1026 for(let i = 0 ; i < controls.length ; i++) {
1027 expect(controls[i].controlName).toEqual(controlsOrderNames[i]);
1032 test('getAlacartFormControls check for mandatory controls', () => {
1033 const controls = getALaCarteFormControls("VF_vMee 0");
1034 const mandatoryControls : string[] = [
1035 FormControlNames.INSTANCE_NAME,
1036 FormControlNames.LCPCLOUD_REGION_ID,
1041 for(let i = 0 ; i < mandatoryControls.length ; i++){
1042 let requiredExist = controls.find(ctrl => ctrl.controlName === mandatoryControls[i]).validations.find(item => item.validatorName === 'required');
1043 expect(requiredExist).toBeDefined();
1047 test('getAlacartFormControls instance name control validator shall have the expected regex', () => {
1048 const controls:FormControlModel[] = getALaCarteFormControls("VF_vMee 0");
1050 const instanceNameControl: FormControlModel = <FormControlModel>controls.find(item => item.controlName === FormControlNames.INSTANCE_NAME);
1051 const instanceNameValidator: ValidatorModel = instanceNameControl.validations.find(val => val.validatorName === ValidatorOptions.pattern);
1052 expect(instanceNameValidator.validatorArg).toEqual(/^[a-zA-Z0-9._-]*$/);
1055 test('rollback should return observable of true, false', () => {
1056 let result : Observable<SelectOption[]> = service.getRollBackOnFailureOptions();
1057 result.subscribe((val)=>{
1058 expect(val).toEqual([
1059 new SelectOption({id: 'true', name: 'Rollback'}),
1060 new SelectOption({id: 'false', name: 'Don\'t Rollback'})