summaryrefslogtreecommitdiffstats
path: root/cps-service/src
diff options
context:
space:
mode:
authorToine Siebelink <toine.siebelink@est.tech>2022-04-29 10:45:02 +0000
committerGerrit Code Review <gerrit@onap.org>2022-04-29 10:45:02 +0000
commitc96cc73a13205ae2eb86388b6cf1e59707763c0c (patch)
tree73062a2f6dfa4d28060b170b500ed4ef3ba87e38 /cps-service/src
parent7f227628678c660b0db3a2da43123d2b531018af (diff)
parent7737d7203349209323b237da7800ec5a3b98cb57 (diff)
Merge "Fix sonar code smells"
Diffstat (limited to 'cps-service/src')
-rw-r--r--cps-service/src/test/groovy/org/onap/cps/yang/YangTextSchemaSourceSetBuilderSpec.groovy (renamed from cps-service/src/test/groovy/org/onap/cps/utils/YangTextSchemaSourceSetSpec.groovy)12
1 files changed, 7 insertions, 5 deletions
diff --git a/cps-service/src/test/groovy/org/onap/cps/utils/YangTextSchemaSourceSetSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/yang/YangTextSchemaSourceSetBuilderSpec.groovy
index b6250612ed..236221aca7 100644
--- a/cps-service/src/test/groovy/org/onap/cps/utils/YangTextSchemaSourceSetSpec.groovy
+++ b/cps-service/src/test/groovy/org/onap/cps/yang/YangTextSchemaSourceSetBuilderSpec.groovy
@@ -1,7 +1,7 @@
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2020-2021 Pantheon.tech
- * Modifications Copyright (C) 2020-2021 Nordix Foundation
+ * Modifications Copyright (C) 2020-2022 Nordix Foundation
* Modifications Copyright (C) 2021 Bell Canada.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,22 +20,24 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.cps.utils
+package org.onap.cps.yang
+
import org.onap.cps.TestUtils
import org.onap.cps.spi.exceptions.ModelValidationException
-import org.onap.cps.yang.YangTextSchemaSourceSetBuilder
import org.opendaylight.yangtools.yang.common.Revision
import spock.lang.Specification
-class YangTextSchemaSourceSetSpec extends Specification {
+class YangTextSchemaSourceSetBuilderSpec extends Specification {
def 'Building a valid YangTextSchemaSourceSet using #filenameCase filename.'() {
given: 'a yang model (file)'
def yangResourceNameToContent = [filename: TestUtils.getResourceFileContent('bookstore.yang')]
when: 'the content is parsed'
def result = YangTextSchemaSourceSetBuilder.of(yangResourceNameToContent).getSchemaContext()
- then: 'the result contains 1 module of the correct name and revision'
+ then: 'it can be validated successfully'
+ YangTextSchemaSourceSetBuilder.validate(yangResourceNameToContent)
+ and: 'the result contains 1 module of the correct name and revision'
result.modules.size() == 1
def optionalModule = result.findModule('stores', Revision.of('2020-09-15'))
optionalModule.isPresent()