a801a7eb9ce3b8ba1ca40cce97a0dfe9a9b78962
[ccsdk/cds.git] / ms / blueprintsprocessor / functions / resource-resolution / src / test / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / functions / resource / resolution / ResourceResolutionServiceTest.kt
1 /*
2  * Copyright © 2017-2018 AT&T Intellectual Property.
3  *
4  * Modifications Copyright © 2018 - 2019 IBM, Bell Canada.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution
20
21 import io.mockk.every
22 import io.mockk.mockk
23 import kotlinx.coroutines.runBlocking
24 import org.junit.Assert
25 import org.junit.Before
26 import org.junit.Test
27 import org.junit.runner.RunWith
28 import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
29 import org.onap.ccsdk.cds.blueprintsprocessor.core.utils.PayloadUtils
30 import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor.MockCapabilityScriptRA
31 import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils
32 import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive
33 import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
34 import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintError
35 import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
36 import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext
37 import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils
38 import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
39 import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResolutionSummary
40 import org.slf4j.LoggerFactory
41 import org.springframework.beans.factory.annotation.Autowired
42 import org.springframework.boot.autoconfigure.EnableAutoConfiguration
43 import org.springframework.context.ApplicationContext
44 import org.springframework.context.annotation.ComponentScan
45 import org.springframework.test.context.ContextConfiguration
46 import org.springframework.test.context.TestPropertySource
47 import org.springframework.test.context.junit4.SpringRunner
48 import kotlin.test.assertEquals
49 import kotlin.test.assertNotNull
50 import kotlin.test.assertTrue
51
52 /**
53  * ResourceResolutionServiceTest
54  *
55  * @author Brinda Santh DATE : 8/15/2018
56  */
57 @RunWith(SpringRunner::class)
58 @ContextConfiguration(
59     classes = [TestDatabaseConfiguration::class]
60 )
61 @TestPropertySource(locations = ["classpath:application-test.properties"])
62 @ComponentScan(basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor", "org.onap.ccsdk.cds.controllerblueprints"])
63 @EnableAutoConfiguration
64 class ResourceResolutionServiceTest {
65
66     private val log = LoggerFactory.getLogger(ResourceResolutionServiceTest::class.java)
67
68     @Autowired
69     lateinit var resourceResolutionService: ResourceResolutionService
70
71     private val props = hashMapOf<String, Any>()
72     private val resolutionKey = "resolutionKey"
73     private val resourceId = "1"
74     private val resourceType = "ServiceInstance"
75     private val occurrence = 0
76
77     @Before
78     fun setup() {
79         props[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_STORE_RESULT] = true
80         props[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOLUTION_KEY] = resolutionKey
81         props[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOURCE_ID] = resourceId
82         props[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOURCE_TYPE] = resourceType
83         props[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_OCCURRENCE] = occurrence
84         props[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOLUTION_SUMMARY] = false
85     }
86
87     @Test
88     fun testRegisteredSource() {
89         val sources = resourceResolutionService.registeredResourceSources()
90         assertNotNull(sources, "failed to get registered sources")
91         assertTrue(
92             sources.containsAll(
93                 arrayListOf(
94                     "source-input", "source-default", "source-db",
95                     "source-rest", "source-capability"
96                 )
97             ),
98             "failed to get registered sources : $sources"
99         )
100     }
101
102     @Test
103     @Throws(Exception::class)
104     fun testResolveResource() {
105         runBlocking {
106
107             Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService)
108
109             val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
110                 "1234",
111                 "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
112             )
113
114             val executionServiceInput =
115                 JacksonUtils.readValueFromClassPathFile(
116                     "payload/requests/sample-resourceresolution-request.json",
117                     ExecutionServiceInput::class.java
118                 )!!
119
120             val resourceAssignmentRuntimeService =
121                 ResourceAssignmentUtils.transformToRARuntimeService(
122                     bluePrintRuntimeService,
123                     "testResolveResource"
124                 )
125
126             // Prepare Inputs
127             PayloadUtils.prepareInputsFromWorkflowPayload(
128                 bluePrintRuntimeService,
129                 executionServiceInput.payload,
130                 "resource-assignment"
131             )
132
133             resourceResolutionService.resolveResources(
134                 resourceAssignmentRuntimeService,
135                 "resource-assignment",
136                 "baseconfig",
137                 props
138             )
139         }.let { (templateMap, assignmentList) ->
140             assertEquals("This is Sample Velocity Template", templateMap)
141
142             val expectedAssignmentList = mutableListOf(
143                 "service-instance-id" to "siid_1234",
144                 "vnf-id" to "vnf_1234",
145                 "vnf_name" to "temp_vnf"
146             )
147             assertEquals(expectedAssignmentList.size, assignmentList.size)
148
149             val areEqual = expectedAssignmentList.zip(assignmentList).all { (it1, it2) ->
150                 it1.first == it2.name && it1.second == it2.property?.value?.asText() ?: null
151             }
152             assertEquals(true, areEqual)
153         }
154     }
155
156     /**
157      * Always perform new resolution even if resolution exists in the database.
158      */
159     @Test
160     @Throws(Exception::class)
161     fun testResolveResourceAlwaysPerformNewResolution() {
162         runBlocking {
163             // Occurrence <= 0 indicates to perform new resolution even if resolution exists in the database.
164             props[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_OCCURRENCE] = -1
165             Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService)
166
167             val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
168                 "1234",
169                 "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
170             )
171
172             // Request#1
173             val executionServiceInput =
174                 JacksonUtils.readValueFromClassPathFile(
175                     "payload/requests/sample-resourceresolution-request.json",
176                     ExecutionServiceInput::class.java
177                 )!!
178
179             val resourceAssignmentRuntimeService =
180                 ResourceAssignmentUtils.transformToRARuntimeService(
181                     bluePrintRuntimeService,
182                     "testResolveResource"
183                 )
184
185             // Prepare inputs from Request#1
186             PayloadUtils.prepareInputsFromWorkflowPayload(
187                 bluePrintRuntimeService,
188                 executionServiceInput.payload,
189                 "resource-assignment"
190             )
191
192             // Resolve resources as per Request#1
193             resourceResolutionService.resolveResources(
194                 resourceAssignmentRuntimeService,
195                 "resource-assignment",
196                 "baseconfig",
197                 props
198             )
199
200             // Request#2
201             val executionServiceInput2 =
202                 JacksonUtils.readValueFromClassPathFile(
203                     "payload/requests/sample-resourceresolution-request2.json",
204                     ExecutionServiceInput::class.java
205                 )!!
206
207             // Prepare inputs from Request#2
208             PayloadUtils.prepareInputsFromWorkflowPayload(
209                 bluePrintRuntimeService,
210                 executionServiceInput2.payload,
211                 "resource-assignment"
212             )
213
214             // Resolve resources as per Request#2
215             resourceResolutionService.resolveResources(
216                 resourceAssignmentRuntimeService,
217                 "resource-assignment",
218                 "baseconfig",
219                 props
220             )
221         }.let { (templateMap, assignmentList) ->
222             assertEquals("This is Sample Velocity Template", templateMap)
223
224             val assignmentListForRequest1 = mutableListOf(
225                 "service-instance-id" to "siid_1234",
226                 "vnf-id" to "vnf_1234",
227                 "vnf_name" to "temp_vnf"
228             )
229             val assignmentListForRequest2 = mutableListOf(
230                 "service-instance-id" to "siid_new_resolution",
231                 "vnf-id" to "vnf_new_resolution",
232                 "vnf_name" to "temp_vnf_new_resolution"
233             )
234             assertEquals(assignmentListForRequest1.size, assignmentList.size)
235             assertEquals(assignmentListForRequest2.size, assignmentList.size)
236
237             // AlwaysPerformNewResolution use case - resolution request #2 should returns the resolution as per
238             // assignmentListForRequest2 since new resolution is performed.
239             var areEqual = assignmentListForRequest1.zip(assignmentList).all { (it1, it2) ->
240                 it1.first == it2.name && it1.second == it2.property?.value?.asText() ?: null
241             }
242             assertEquals(false, areEqual)
243
244             areEqual = assignmentListForRequest2.zip(assignmentList).all { (it1, it2) ->
245                 it1.first == it2.name && it1.second == it2.property?.value?.asText() ?: null
246             }
247             assertEquals(true, areEqual)
248         }
249     }
250
251     /**
252      * Don't perform new resolution in case resolution already exists in the database.
253      */
254     @Test
255     @Throws(Exception::class)
256     fun testResolveResourceNoNewResolution() {
257         runBlocking {
258             // Occurrence > 0 indicates to not perform new resolution if resolution exists in the database.
259             props[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_OCCURRENCE] = 1
260             Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService)
261
262             val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
263                 "1234",
264                 "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
265             )
266
267             // Request#1
268             val executionServiceInput =
269                 JacksonUtils.readValueFromClassPathFile(
270                     "payload/requests/sample-resourceresolution-request.json",
271                     ExecutionServiceInput::class.java
272                 )!!
273
274             val resourceAssignmentRuntimeService =
275                 ResourceAssignmentUtils.transformToRARuntimeService(
276                     bluePrintRuntimeService,
277                     "testResolveResource"
278                 )
279
280             // Prepare inputs from Request#1
281             PayloadUtils.prepareInputsFromWorkflowPayload(
282                 bluePrintRuntimeService,
283                 executionServiceInput.payload,
284                 "resource-assignment"
285             )
286             // Resolve resources as per Request#1
287             resourceResolutionService.resolveResources(
288                 resourceAssignmentRuntimeService,
289                 "resource-assignment",
290                 "baseconfig",
291                 props
292             )
293
294             // Request#2
295             val executionServiceInput2 =
296                 JacksonUtils.readValueFromClassPathFile(
297                     "payload/requests/sample-resourceresolution-request2.json",
298                     ExecutionServiceInput::class.java
299                 )!!
300
301             // Prepare inputs from Request#2
302             PayloadUtils.prepareInputsFromWorkflowPayload(
303                 bluePrintRuntimeService,
304                 executionServiceInput2.payload,
305                 "resource-assignment"
306             )
307
308             // Resolve resources as per Request#2
309             resourceResolutionService.resolveResources(
310                 resourceAssignmentRuntimeService,
311                 "resource-assignment",
312                 "baseconfig",
313                 props
314             )
315         }.let { (templateMap, assignmentList) ->
316             assertEquals("This is Sample Velocity Template", templateMap)
317
318             val assignmentListForRequest1 = mutableListOf(
319                 "service-instance-id" to "siid_1234",
320                 "vnf-id" to "vnf_1234",
321                 "vnf_name" to "temp_vnf"
322             )
323             val assignmentListForRequest2 = mutableListOf(
324                 "service-instance-id" to "siid_new_resolution",
325                 "vnf-id" to "vnf_new_resolution",
326                 "vnf_name" to "temp_vnf_new_resolution"
327             )
328             assertEquals(assignmentListForRequest1.size, assignmentList.size)
329             assertEquals(assignmentListForRequest2.size, assignmentList.size)
330
331             //  NoNewResolution use case - resolution for request #2 returns the same resolution  as
332             //  assignmentListForRequest1 since no new resolution is/was actually performed.
333             var areEqual = assignmentListForRequest1.zip(assignmentList).all { (it1, it2) ->
334                 it1.first == it2.name && it1.second == it2.property?.value?.asText() ?: null
335             }
336             assertEquals(true, areEqual)
337
338             areEqual = assignmentListForRequest2.zip(assignmentList).all { (it1, it2) ->
339                 it1.first == it2.name && it1.second == it2.property?.value?.asText() ?: null
340             }
341             assertEquals(false, areEqual)
342         }
343     }
344
345     @Test
346     @Throws(Exception::class)
347     fun testResolveResources() {
348         val artifactNames = listOf("baseconfig", "another")
349         runBlocking {
350             Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService)
351
352             val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
353                 "1234",
354                 "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
355             )
356
357             val executionServiceInput =
358                 JacksonUtils.readValueFromClassPathFile(
359                     "payload/requests/sample-resourceresolution-request.json",
360                     ExecutionServiceInput::class.java
361                 )!!
362
363             // Prepare Inputs
364             PayloadUtils.prepareInputsFromWorkflowPayload(
365                 bluePrintRuntimeService,
366                 executionServiceInput.payload,
367                 "resource-assignment"
368             )
369
370             resourceResolutionService.resolveResources(
371                 bluePrintRuntimeService,
372                 "resource-assignment",
373                 artifactNames,
374                 props,
375                 "mockStep"
376             )
377         }.let {
378             assertEquals(artifactNames.toSet(), it.templateMap.keys)
379             assertEquals(artifactNames.toSet(), it.assignmentMap.keys)
380
381             assertEquals("This is Sample Velocity Template", it.templateMap["another"])
382             assertEquals("vnf_1234", it.assignmentMap["another"]!!["vnf-id"]!!.asText())
383         }
384     }
385
386     @Test
387     @Throws(Exception::class)
388     fun testResolveResourcesWithMappingAndTemplate() {
389         runBlocking {
390             Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService)
391
392             val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
393                 "1234",
394                 "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
395             )
396
397             val executionServiceInput =
398                 JacksonUtils.readValueFromClassPathFile(
399                     "payload/requests/sample-resourceresolution-request.json",
400                     ExecutionServiceInput::class.java
401                 )!!
402
403             val resourceAssignmentRuntimeService =
404                 ResourceAssignmentUtils.transformToRARuntimeService(
405                     bluePrintRuntimeService,
406                     "testResolveResourcesWithMappingAndTemplate"
407                 )
408
409             val artifactPrefix = "another"
410
411             // Prepare Inputs
412             PayloadUtils.prepareInputsFromWorkflowPayload(
413                 bluePrintRuntimeService,
414                 executionServiceInput.payload,
415                 "resource-assignment"
416             )
417
418             assertNotNull(
419                 resourceResolutionService.resolveResources(
420                     resourceAssignmentRuntimeService,
421                     "resource-assignment",
422                     artifactPrefix,
423                     props
424                 ),
425                 "Couldn't Resolve Resources for artifact $artifactPrefix"
426             )
427         }
428     }
429
430     @Test
431     @Throws(Exception::class)
432     fun testResolveResourcesResolutionSummary() {
433         runBlocking {
434             props[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOLUTION_SUMMARY] = true
435             Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService)
436
437             val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
438                 "1234",
439                 "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
440             )
441
442             val executionServiceInput =
443                 JacksonUtils.readValueFromClassPathFile(
444                     "payload/requests/sample-resourceresolution-request.json",
445                     ExecutionServiceInput::class.java
446                 )!!
447
448             val resourceAssignmentRuntimeService =
449                 ResourceAssignmentUtils.transformToRARuntimeService(
450                     bluePrintRuntimeService,
451                     "testResolveResourcesWithMappingAndTemplate"
452                 )
453
454             val artifactPrefix = "notemplate"
455
456             // Prepare Inputs
457             PayloadUtils.prepareInputsFromWorkflowPayload(
458                 bluePrintRuntimeService,
459                 executionServiceInput.payload,
460                 "resource-assignment"
461             )
462
463             resourceResolutionService.resolveResources(
464                 resourceAssignmentRuntimeService,
465                 "resource-assignment",
466                 artifactPrefix,
467                 props
468             )
469         }.let {
470             val summaries = JacksonUtils.jsonNode(it.first)["resolution-summary"]
471             val list = JacksonUtils.getListFromJsonNode(summaries, ResolutionSummary::class.java)
472             assertEquals(list.size, 3)
473         }
474     }
475
476     @Test
477     @Throws(Exception::class)
478     fun testResolveResourcesWithoutTemplate() {
479         val artifactPrefix = "notemplate"
480         runBlocking {
481             Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService)
482
483             val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
484                 "1234",
485                 "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
486             )
487
488             val executionServiceInput =
489                 JacksonUtils.readValueFromClassPathFile(
490                     "payload/requests/sample-resourceresolution-request.json",
491                     ExecutionServiceInput::class.java
492                 )!!
493
494             val resourceAssignmentRuntimeService =
495                 ResourceAssignmentUtils.transformToRARuntimeService(
496                     bluePrintRuntimeService,
497                     "testResolveResourcesWithMappingAndTemplate"
498                 )
499
500             // Prepare Inputs
501             PayloadUtils.prepareInputsFromWorkflowPayload(
502                 bluePrintRuntimeService,
503                 executionServiceInput.payload,
504                 "resource-assignment"
505             )
506
507             resourceResolutionService.resolveResources(
508                 resourceAssignmentRuntimeService,
509                 "resource-assignment",
510                 artifactPrefix,
511                 props
512             )
513         }.let {
514             assertEquals(
515                 """
516                 {
517                   "service-instance-id" : "siid_1234",
518                   "vnf-id" : "vnf_1234",
519                   "vnf_name" : "temp_vnf"
520                 }
521                 """.trimIndent(),
522                 it.first
523             )
524             val areEqual = it.second.first().name == "service-instance-id" &&
525                 "siid_1234" == it.second.first().property?.value?.asText() ?: null
526             assertEquals(true, areEqual)
527         }
528     }
529
530     @Test
531     fun testResolveResourcesWithResourceIdAndResourceType() {
532         props[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOLUTION_KEY] = ""
533         runBlocking {
534             Assert.assertNotNull("failed to create ResourceResolutionService", resourceResolutionService)
535
536             val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
537                 "1234",
538                 "./../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
539             )
540
541             val executionServiceInput =
542                 JacksonUtils.readValueFromClassPathFile(
543                     "payload/requests/sample-resourceresolution-request.json",
544                     ExecutionServiceInput::class.java
545                 )!!
546
547             val resourceAssignmentRuntimeService =
548                 ResourceAssignmentUtils.transformToRARuntimeService(
549                     bluePrintRuntimeService,
550                     "testResolveResourcesWithMappingAndTemplate"
551                 )
552
553             val artifactPrefix = "another"
554
555             // Prepare Inputs
556             PayloadUtils.prepareInputsFromWorkflowPayload(
557                 bluePrintRuntimeService,
558                 executionServiceInput.payload,
559                 "resource-assignment"
560             )
561
562             assertNotNull(
563                 resourceResolutionService.resolveResources(
564                     resourceAssignmentRuntimeService,
565                     "resource-assignment",
566                     artifactPrefix,
567                     props
568                 ),
569                 "Couldn't Resolve Resources for artifact $artifactPrefix"
570             )
571         }
572     }
573
574     @Test
575     fun testResourceResolutionForDefinition() {
576         val resourceDefinitions = BluePrintTypes.resourceDefinitions {
577             resourceDefinition(name = "port-speed", description = "Port Speed") {
578                 property(type = "string", required = true)
579                 sources {
580                     sourceCapability(id = "sdno", description = "SDNO Source") {
581                         definedProperties {
582                             type(BluePrintConstants.SCRIPT_KOTLIN)
583                             scriptClassReference(MockCapabilityScriptRA::class.qualifiedName!!)
584                             keyDependencies(arrayListOf("device-id"))
585                         }
586                     }
587                     sourceDb(id = "sdnc", description = "SDNC Controller") {
588                         definedProperties {
589                             endpointSelector("processor-db")
590                             query("SELECT PORT_SPEED FROM XXXX WHERE DEVICE_ID = :device_id")
591                             inputKeyMapping {
592                                 map("device_id", "\$device-id")
593                             }
594                             keyDependencies(arrayListOf("device-id"))
595                         }
596                     }
597                 }
598             }
599             resourceDefinition(name = "device-id", description = "Device Id") {
600                 property(type = "string", required = true) {
601                     sources {
602                         sourceInput(id = "input", description = "Dependency Source") {}
603                     }
604                 }
605             }
606         }
607         runBlocking {
608             val raRuntimeService = mockk<ResourceAssignmentRuntimeService>()
609             every { raRuntimeService.bluePrintContext() } returns mockk<BluePrintContext>()
610             every { raRuntimeService.getBluePrintError() } returns BluePrintError()
611             every { raRuntimeService.setBluePrintError(any()) } returns Unit
612             every { raRuntimeService.getInputValue("device-id") } returns "123456".asJsonPrimitive()
613             every { raRuntimeService.putResolutionStore(any(), any()) } returns Unit
614
615             val applicationContext = mockk<ApplicationContext>()
616             every { applicationContext.getBean("rr-processor-source-capability") } returns MockCapabilityScriptRA()
617             every { applicationContext.getBean("rr-processor-source-db") } returns MockCapabilityScriptRA()
618             every { applicationContext.getBean("rr-processor-source-input") } returns MockCapabilityScriptRA()
619
620             val sources = arrayListOf<String>("sdno", "sdnc")
621
622             val resourceResolutionService = ResourceResolutionServiceImpl(applicationContext, mockk(), mockk(), mockk())
623             val resolvedResources = resourceResolutionService.resolveResourceDefinition(
624                 raRuntimeService,
625                 resourceDefinitions, "port-speed", sources
626             )
627             assertNotNull(resolvedResources, "failed to resolve the resources")
628         }
629     }
630 }