summaryrefslogtreecommitdiffstats
path: root/integration-test/src
diff options
context:
space:
mode:
authorhalil.cakal <halil.cakal@est.tech>2024-01-23 10:05:36 +0000
committerhalil.cakal <halil.cakal@est.tech>2024-02-01 16:41:39 +0000
commit04280e2f93bbf30e8654c411bb1e107d275c22bb (patch)
treefaf4ac9ae4d80617f6b11cb0d78174e0c12452db /integration-test/src
parent0f6a966b363e5347de2d44b1527d19b4cf2825a6 (diff)
Extend API: Get Module Definitions
- add query parameters: module-name and revision to OpenAPI - extend the controller method to hande the new parameters - add the new method stack to the service layer - extend the SQL query to support the new parameters - add unit and integration testwares Issue-ID: CPS-1135 Change-Id: I089ad2ad71effb58ac0ba809e9f441d6cdb59c4f Signed-off-by: halil.cakal <halil.cakal@est.tech>
Diffstat (limited to 'integration-test/src')
-rw-r--r--integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsModuleServiceIntegrationSpec.groovy14
1 files changed, 12 insertions, 2 deletions
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsModuleServiceIntegrationSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsModuleServiceIntegrationSpec.groovy
index cf0e0b5944..8029ae0428 100644
--- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsModuleServiceIntegrationSpec.groovy
+++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsModuleServiceIntegrationSpec.groovy
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2023 Nordix Foundation
+ * Copyright (C) 2023-2024 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
@@ -21,7 +21,6 @@
package org.onap.cps.integration.functional
import org.onap.cps.api.CpsModuleService
-import org.onap.cps.api.impl.CpsModuleServiceImpl
import org.onap.cps.integration.base.FunctionalSpecBase
import org.onap.cps.spi.CascadeDeleteAllowed
import org.onap.cps.spi.exceptions.AlreadyDefinedException
@@ -153,6 +152,17 @@ class CpsModuleServiceIntegrationSpec extends FunctionalSpecBase {
result == [new ModuleDefinition('stores','2020-09-15','')]
}
+ def 'Retrieving module definitions: #scenarios'() {
+ when: 'module definitions for module name are retrieved'
+ def result = objectUnderTest.getModuleDefinitionsByAnchorAndModule(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_ANCHOR_1, moduleName, moduleRevision)
+ then: 'the correct module definitions are returned'
+ result == [new ModuleDefinition('stores','2020-09-15','')]
+ where: 'following parameters are used'
+ scenarios | moduleName | moduleRevision
+ 'both specified' | 'stores' | '2020-09-15'
+ 'module name specified' | 'stores' | null
+ }
+
def 'Retrieving yang resource module references by anchor.'() {
when: 'the yang resource module references for an anchor are retrieved'
def result = objectUnderTest.getYangResourcesModuleReferences(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_ANCHOR_1)