diff options
-rw-r--r-- | pom.xml | 21 | ||||
-rw-r--r-- | src/main/resources/application.yml | 9 | ||||
-rw-r--r-- | src/test/groovy/org/onap/cps/ncmp/dmi/service/operation/SdncOperationsSpec.groovy | 32 |
3 files changed, 38 insertions, 24 deletions
@@ -52,7 +52,7 @@ <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> - <version>2.5.5</version> + <version>2.6.4</version> <type>pom</type> <scope>import</scope> </dependency> @@ -64,20 +64,17 @@ <scope>import</scope> </dependency> <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-api</artifactId> - <version>2.17.1</version> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-to-slf4j</artifactId> - <version>2.17.1</version> - </dependency> - <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.8.9</version> </dependency> + <dependency> + <groupId>org.springframework.cloud</groupId> + <artifactId>spring-cloud-dependencies</artifactId> + <version>2021.0.1</version> + <type>pom</type> + <scope>import</scope> + </dependency> </dependencies> </dependencyManagement> <dependencies> @@ -251,7 +248,7 @@ <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> - <version>2.3.3.RELEASE</version> + <version>2.6.4</version> <executions> <execution> <goals> diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 67cd28ee..2d324c5b 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -34,6 +34,15 @@ security: username: ${DMI_USERNAME} password: ${DMI_PASSWORD} +# When updating to sprinboot 2.6.4 an exception would occur when starting the container +# "Failed to start bean 'documentationPluginsBootstrapper'. +# This is a known issue with springfox and springboot introduced in 2.6.x: +# https://github.com/springfox/springfox/issues/3462 +spring: + mvc: + pathmatch: + matching-strategy: ANT_PATH_MATCHER + # Actuator management: server: diff --git a/src/test/groovy/org/onap/cps/ncmp/dmi/service/operation/SdncOperationsSpec.groovy b/src/test/groovy/org/onap/cps/ncmp/dmi/service/operation/SdncOperationsSpec.groovy index 98add77b..c71f6d92 100644 --- a/src/test/groovy/org/onap/cps/ncmp/dmi/service/operation/SdncOperationsSpec.groovy +++ b/src/test/groovy/org/onap/cps/ncmp/dmi/service/operation/SdncOperationsSpec.groovy @@ -84,6 +84,7 @@ class SdncOperationsSpec extends Specification { moduleSchemas.size() == 0 where: scenario | responseBody + 'null response body' | null 'empty response body ' | '' 'no module schema' | '{ "ietf-netconf-monitoring:schemas" : { "schema" : [] } } ' } @@ -116,14 +117,19 @@ class SdncOperationsSpec extends Specification { 1 * mockSdncRestClient.httpOperationWithJsonData(HttpMethod.POST, expectedUrl, 'some-json-data', _ as HttpHeaders) } - def 'Get resource data from node to SDNC.'() { + def 'Get resource data from node to SDNC. with#scenario accept header'() { given: 'expected url, topology-id, sdncOperation object' def expectedUrl = '/rests/data/network-topology:network-topology/topology=test-topology/node=node1/yang-ext:mount/testResourceId?a=1&b=2&content=testContent' when: 'called get modules from node' objectUnderTest.getResouceDataForOperationalAndRunning('node1', 'testResourceId', - '(a=1,b=2)', 'testAcceptParam', 'content=testContent') - then: 'the get operation is executed with the correct URL' - 1 * mockSdncRestClient.getOperation(expectedUrl, _ as HttpHeaders) + '(a=1,b=2)', acceptParamInHeader, 'content=testContent') + then: 'the get operation is executed with the correct URL and Http headers' + 1 * mockSdncRestClient.getOperation(expectedUrl, expectedHttpHeaders) + where: + scenario | acceptParamInHeader || expectedHttpHeaders + 'test' | 'test' || new HttpHeaders([Accept:'test']) + 'empty' | '' || new HttpHeaders() + 'null' | null || new HttpHeaders() } def 'Write resource data with #scenario operation to SDNC.'() { @@ -142,20 +148,22 @@ class SdncOperationsSpec extends Specification { 'Patch' | PATCH || HttpMethod.PATCH } - def 'build query param list for SDNC where options contains a #scenario'() { + def 'build query param list for SDNC where options #scenario'() { when: 'build query param list is called with #scenario' def result = objectUnderTest.buildQueryParamMap(optionsParamInQuery, 'd=4') .toSingleValueMap().toString() then: 'result equals to expected result' result == expectedResult where: 'following parameters are used' - scenario | optionsParamInQuery || expectedResult - 'single key-value pair' | '(a=x)' || '[a:x, d:4]' - 'multiple key-value pairs' | '(a=x,b=y,c=z)' || '[a:x, b:y, c:z, d:4]' - '/ as special char' | '(a=x,b=y,c=t/z)' || '[a:x, b:y, c:t/z, d:4]' - '" as special char' | '(a=x,b=y,c="z")' || '[a:x, b:y, c:"z", d:4]' - '[] as special char' | '(a=x,b=y,c=[z])' || '[a:x, b:y, c:[z], d:4]' - '= in value' | '(a=(x=y),b=x=y)' || '[a:(x=y), b:x=y, d:4]' + scenario | optionsParamInQuery || expectedResult + 'is single key-value pair' | '(a=x)' || '[a:x, d:4]' + 'is multiple key-value pairs' | '(a=x,b=y,c=z)' || '[a:x, b:y, c:z, d:4]' + 'has / as special char' | '(a=x,b=y,c=t/z)' || '[a:x, b:y, c:t/z, d:4]' + 'has " as special char' | '(a=x,b=y,c="z")' || '[a:x, b:y, c:"z", d:4]' + 'has [] as special char' | '(a=x,b=y,c=[z])' || '[a:x, b:y, c:[z], d:4]' + 'has = in value' | '(a=(x=y),b=x=y)' || '[a:(x=y), b:x=y, d:4]' + 'is empty' | '' || '[:]' + 'is null' | null || '[:]' } def 'options parameters contains a comma #scenario'() { |