Fix postschemas test failures 04/14704/1
authorKrupaNagabhushan <krupa.nagabhushan@est.tech>
Mon, 7 Jul 2025 11:29:37 +0000 (12:29 +0100)
committerKrupaNagabhushan <krupa.nagabhushan@est.tech>
Mon, 7 Jul 2025 11:29:59 +0000 (12:29 +0100)
Issue-ID: SMO-191
Change-Id: Ia957779cafd48a35c7dcb0d1cd385cec35aad1e0
Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech>
teiv/src/main/java/org/oran/smo/teiv/utils/YangParser.java
teiv/src/main/java/org/oran/smo/teiv/utils/yangparser/ExposureYangParser.java
teiv/src/test/resources/contracts/exposure/schemas/02_postSchemas.groovy

index f0f6c32..83ce995 100644 (file)
@@ -30,6 +30,7 @@ import java.util.*;
 
 import org.oran.smo.teiv.exception.TeivException;
 import org.oran.smo.teiv.exception.YangModelException;
+import org.oran.smo.teiv.utils.yangparser.ExposureYangParser;
 import org.oran.smo.yangtools.parser.data.YangData;
 import org.oran.smo.yangtools.parser.findings.FindingSeverity;
 import org.oran.smo.yangtools.parser.findings.ModuleAndFindingTypeAndSchemaNodePathFilterPredicate;
@@ -134,6 +135,7 @@ public class YangParser {
         context.setIgnoreImportedProtocolAccessibleObjects(true);
         context.setFailFast(false);
         yangDeviceModel.parseIntoYangModels(context, yangModels);
+        ExposureYangParser.validateContext(findingsManager);
         checkFindings(context.getFindingsManager(), severityCalculator);
 
         assert inputYangModel != null;
index a46ff9f..6ded4ff 100644 (file)
@@ -32,6 +32,7 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.CopyOnWriteArrayList;
 
 import org.oran.smo.teiv.exception.YangException;
+import org.oran.smo.yangtools.parser.findings.FindingsManager;
 import org.springframework.web.multipart.MultipartFile;
 
 import org.oran.smo.yangtools.parser.ParserExecutionContext;
@@ -137,4 +138,8 @@ public class ExposureYangParser extends YangModelLoader {
         return resultMap;
     }
 
+    public static void validateContext(FindingsManager findingsManager) {
+        YangFindingsManager.handleExposureFindings(findingsManager);
+    }
+
 }
index 60b7225..ddc5216 100644 (file)
@@ -716,7 +716,7 @@ import org.springframework.cloud.contract.spec.Contract
             body('''{
                 "status": "BAD_REQUEST",
                 "message": "Invalid file input",
-                "details": "Invalid file input: Module 'o-ran-smo-teiv-ran' multiple times in the input, with both conformance types IMPLEMENT and IMPORT."
+                "details": "Invalid file input: Module 'o-ran-smo-teiv-ran' has multiple revisions in the input, but desired exact revision not specified in the 'import' statement."
             }''')
         }
     },
@@ -770,7 +770,7 @@ import org.springframework.cloud.contract.spec.Contract
             body('''{
             "status": "BAD_REQUEST",
             "message": "Invalid file input",
-            "details": "Invalid file input: Missing content at the beginning of the document."
+            "details": "Invalid file input: Expected single statement ('module' or 'submodule')."
         }''')
         }
     },