Add missing duplication test in integration test suite 03/139203/1
authorToineSiebelink <toine.siebelink@est.tech>
Tue, 15 Oct 2024 17:01:30 +0000 (18:01 +0100)
committerToineSiebelink <toine.siebelink@est.tech>
Tue, 15 Oct 2024 17:12:55 +0000 (18:12 +0100)
- Added test for  ModuleSerive.createSchemaSetFromModules()
- Unintendedly Updated one swagger file in docs because
1) DT team forgot to update the relevant file
2) Gers committed pom update to automatically update swagger files
3) I ran 'mvn install'

Issue-ID: CPS-2399
Change-Id: I33261c32bbca58ff21aff3cde9588617199f104c
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
docs/api/swagger/cps/openapi.yaml
integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/ModuleServiceIntegrationSpec.groovy

index d22b288..87c6378 100644 (file)
@@ -1451,6 +1451,15 @@ paths:
         schema:
           default: /
           type: string
+      - description: "Boolean flag to validate data, without persisting it. Default\
+          \ value is set to false."
+        in: query
+        name: dry-run
+        required: false
+        schema:
+          default: false
+          example: false
+          type: boolean
       - description: observed-timestamp
         in: query
         name: observed-timestamp
@@ -2550,6 +2559,16 @@ components:
       schema:
         example: application/json
         type: string
+    dryRunInQuery:
+      description: "Boolean flag to validate data, without persisting it. Default\
+        \ value is set to false."
+      in: query
+      name: dry-run
+      required: false
+      schema:
+        default: false
+        example: false
+        type: boolean
     requiredXpathInQuery:
       description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/xpath.html"
       examples:
index 5f4ba34..9e51d80 100644 (file)
@@ -134,7 +134,7 @@ class ModuleServiceIntegrationSpec extends FunctionalSpecBase {
             objectUnderTest.deleteSchemaSetsWithCascade(FUNCTIONAL_TEST_DATASPACE_1, [ 'newSchema1', 'newSchema2'])
     }
 
-    def 'Create schema set error scenario: #scenario.'() {
+    def 'Attempt to create schema set, error scenario: #scenario.'() {
         when: 'attempt to store schema set #schemaSetName in dataspace #dataspaceName'
             populateNewYangResourcesNameToContentMapAndAllModuleReferences(0)
             objectUnderTest.createSchemaSet(dataspaceName, schemaSetName, newYangResourcesNameToContentMap)
@@ -146,6 +146,14 @@ class ModuleServiceIntegrationSpec extends FunctionalSpecBase {
             'schema set already exists' | FUNCTIONAL_TEST_DATASPACE_1 | BOOKSTORE_SCHEMA_SET || AlreadyDefinedException
     }
 
+    def 'Attempt to create duplicate schema set from modules.'() {
+        when: 'attempt to store duplicate schema set from modules'
+            objectUnderTest.createSchemaSetFromModules(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_SCHEMA_SET, newYangResourcesNameToContentMap, [])
+        then: 'an Already Defined Exception is thrown'
+            thrown(AlreadyDefinedException)
+    }
+
+
     /*
         R E A D   S C H E M A   S E T   I N F O   U S E - C A S E S
      */