1 import {createRequest} from './mso.factory';
3 sessionStorage.setItem("msoRequestParametersTestApiValue","GR_API");
4 describe('Vlantagging', () => {
5 it('should create a correct request', (done: DoneFn) => {
6 let userInputs_withEcompGeneratedNaming = {
7 "productFamily": "e433710f-9217-458d-a79d-1c7aff376d89",
8 "lcpRegion": "AAIAIC25",
9 "tenantId": "092eb9e8e4b7412e8787dd091bc58e86",
11 "platformName": "plat1",
12 "lineOfBusiness": "ecomp"
14 let userInputs_withoutEcompGeneratedNaming = {
15 "instanceName": "New Name",
16 "productFamily": "e433710f-9217-458d-a79d-1c7aff376d89",
17 "lcpRegion": "AAIAIC25",
18 "tenantId": "092eb9e8e4b7412e8787dd091bc58e86",
20 "platformName": "plat1",
21 "lineOfBusiness": "ecomp"
25 "uuid": "6bce7302-70bd-4057-b48e-8d5b99e686ca",
26 "invariantUuid": "9aa04749-c02c-432d-a90c-18caa361c833",
29 "toscaModelURL": null,
30 "category": "Network L4+",
33 "description": "vDBE_srv",
34 "serviceEcompNaming": "true",
35 "instantiationType": "A-La-Carte",
40 "uuid": "61535073-2e50-4141-9000-f66fea69b433",
41 "invariantUuid": "fcdf49ce-6f0b-4ca2-b676-a484e650e734",
42 "description": "vDBE",
45 "customizationUuid": "1",
49 "nf_naming": "{ecomp_generated_naming=true}",
50 "multi_stage_design": "false",
51 "oam_vfc_instance_group_function": "oambbb",
52 "availability_zone_max_count": "1",
53 "oam_network_collection_function": "oamaaa",
54 "ecomp_generated_naming": "true",
55 "untr_vfc_instance_group_function": "untrbbb",
56 "untr_network_collection_function": "untraaa"
59 "modelCustomizationName": "vDBE 0",
61 "vdbe0..Vdbe..main..module-0": {
62 "uuid": "25a4d009-2f5a-44b4-b02a-62c584c15912",
63 "invariantUuid": "614afb1a-3e7e-44e9-90ab-424d0070c781",
64 "customizationUuid": "3443b341-7b0b-498c-a84a-a7ee736cba7e",
66 "name": "Vdbe..main..module-0",
68 "modelCustomizationName": "Vdbe..main..module-0",
70 "minCountInstances": 1,
71 "maxCountInstances": 1,
73 "vfModuleLabel": "main"
76 "volumeGroupAllowed": false
80 "vfcInstanceGroups": {
82 "uuid": "5fca04e2-a889-4579-8338-f60f1bf285fa",
83 "invariantUuid": "fb1e384b-117a-46ae-9ad1-bf2f1ee1e49f",
86 "vfcInstanceGroupProperties": {
87 "vfcParentPortRole": "untr",
88 "networkCollectionFunction": "untraaa",
89 "vfcInstanceGroupFunction": null,
90 "subinterfaceRole": "untr"
94 "uuid": "a0efd5fc-f7be-4502-936a-a6c6392b958f",
95 "invariantUuid": "9384abf9-1231-4da4-bd8d-89e4d2f8a749",
98 "vfcInstanceGroupProperties": {
99 "vfcParentPortRole": "untr",
100 "networkCollectionFunction": "untraaa",
101 "vfcInstanceGroupFunction": null,
102 "subinterfaceRole": "untr"
109 "collectionResource": {},
110 "configurations": {},
111 "serviceProxies": {},
113 "vdbe0..Vdbe..main..module-0": {
114 "uuid": "25a4d009-2f5a-44b4-b02a-62c584c15912",
115 "invariantUuid": "614afb1a-3e7e-44e9-90ab-424d0070c781",
116 "customizationUuid": "3443b341-7b0b-498c-a84a-a7ee736cba7e",
118 "name": "Vdbe..main..module-0",
120 "modelCustomizationName": "Vdbe..main..module-0",
122 "minCountInstances": 1,
123 "maxCountInstances": 1,
125 "vfModuleLabel": "main"
128 "volumeGroupAllowed": false
134 let serviceInstanceId: string = "6bce7302-70bd-4057-b48e-8d5b99e686ca";
135 let networkInstanceGroups = {
138 "instance-group-role": "JZmha7QSS4tJ",
139 "model-invariant-id": "model-id3",
140 "model-version-id": "a0efd5fc-f7be-4502-936a-a6c6392b958f",
141 "id": "AAI-12002-test3-vm230w",
142 "description": "a9DEa0kpY",
143 "instance-group-type": "type",
144 "resource-version": "1520888659539",
145 "instance-group-name": "wKmBXiO1xm8bK",
146 "instance-group-function": "testfunction2",
147 "relationship-list": {
150 "relationDataList": [
152 "relationship-key": "cloud-region.cloud-owner",
153 "relationship-value": "AAI-12002-vm230w"
156 "relationship-key": "cloud-region.cloud-region-id",
157 "relationship-value": "AAI-region-vm230w"
160 "relatedToPropertyList": [
162 "property-key": "cloud-region.owner-defined-type",
163 "property-value": null
166 "related-to": "cloud-region",
167 "related-link": "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/AAI-12002-vm230w/AAI-region-vm230w",
168 "relationship-label": "org.onap.relationships.inventory.Uses",
169 "relationship-data": [
171 "relationship-key": "cloud-region.cloud-owner",
172 "relationship-value": "AAI-12002-vm230w"
175 "relationship-key": "cloud-region.cloud-region-id",
176 "relationship-value": "AAI-region-vm230w"
179 "related-to-property": [
181 "property-key": "cloud-region.owner-defined-type",
182 "property-value": null
192 "instance-group-role": "JZmha7QSS4tJ",
193 "model-invariant-id": "model-id3",
194 "model-version-id": "a0efd5fc-f7be-4502-936a-a6c6392b958f",
195 "id": "AAI-12002-test3-vm230w",
196 "description": "a9DEa0kpY",
197 "instance-group-type": "type",
198 "resource-version": "1520888659539",
199 "instance-group-name": "wKmBXiO1xm8bK",
200 "instance-group-function": "testfunction2",
201 "relationship-list": {
204 "relationDataList": [
206 "relationship-key": "cloud-region.cloud-owner",
207 "relationship-value": "AAI-12002-vm230w"
210 "relationship-key": "cloud-region.cloud-region-id",
211 "relationship-value": "AAI-region-vm230w"
214 "relatedToPropertyList": [
216 "property-key": "cloud-region.owner-defined-type",
217 "property-value": null
220 "related-to": "cloud-region",
221 "related-link": "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/AAI-12002-vm230w/AAI-region-vm230w",
222 "relationship-label": "org.onap.relationships.inventory.Uses",
223 "relationship-data": [
225 "relationship-key": "cloud-region.cloud-owner",
226 "relationship-value": "AAI-12002-vm230w"
229 "relationship-key": "cloud-region.cloud-region-id",
230 "relationship-value": "AAI-region-vm230w"
233 "related-to-property": [
235 "property-key": "cloud-region.owner-defined-type",
236 "property-value": null
245 let expectedResult = {
247 "productFamilyId": "e433710f-9217-458d-a79d-1c7aff376d89",
249 "requestorId": "az2016",
250 "suppressRollback": false
252 "lineOfBusiness": Object({ lineOfBusinessName: "ecomp" }),
253 "cloudConfiguration": {
254 "lcpCloudRegionId": "AAIAIC25",
255 "tenantId": "092eb9e8e4b7412e8787dd091bc58e86"
257 "platform": Object({ platformName: "plat1" }),
259 modelCustomizationId :'1',
260 "modelVersionId": "61535073-2e50-4141-9000-f66fea69b433",
261 "modelCustomizationName": "vDBE 0",
263 "modelInvariantId": "fcdf49ce-6f0b-4ca2-b676-a484e650e734",
265 "modelVersion": "0.2"
267 "requestParameters": {
271 "relatedInstanceList": [
274 "instanceId": "6bce7302-70bd-4057-b48e-8d5b99e686ca",
276 "modelVersionId": "6bce7302-70bd-4057-b48e-8d5b99e686ca",
277 "modelName": "vDBE_srv",
278 "modelInvariantId": "9aa04749-c02c-432d-a90c-18caa361c833",
279 "modelType": "service",
280 "modelVersion": "1.0"
286 "instanceId": "AAI-12002-test3-vm230w",
288 "modelName": "oam_group",
289 "modelType": "networkCollection",
291 "modelVersionId": "a0efd5fc-f7be-4502-936a-a6c6392b958f",
292 "modelInvariantId": "9384abf9-1231-4da4-bd8d-89e4d2f8a749"
298 "instanceId": "AAI-12002-test3-vm230w",
300 "modelName": "oam_group",
301 "modelType": "networkCollection",
303 "modelVersionId": "a0efd5fc-f7be-4502-936a-a6c6392b958f",
304 "modelInvariantId": "9384abf9-1231-4da4-bd8d-89e4d2f8a749"
312 let actualResult_withEcompGeneratedNaming = <any>createRequest("az2016",userInputs_withEcompGeneratedNaming, service, serviceInstanceId, networkInstanceGroups,'vDBE 0','1');
313 expect(actualResult_withEcompGeneratedNaming).toEqual(expectedResult);
314 expectedResult["requestInfo"]["instanceName"] = "New Name";
315 let actualResult_withoutEcompGeneratedNaming = <any>createRequest("az2016",userInputs_withoutEcompGeneratedNaming, service, serviceInstanceId, networkInstanceGroups,'vDBE 0','1');
316 expect(actualResult_withoutEcompGeneratedNaming).toEqual(expectedResult);