aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-rest
diff options
context:
space:
mode:
authorJvD_Ericsson <jeff.van.dam@est.tech>2024-02-16 09:30:45 +0000
committerJeff van Dam <jeff.van.dam@est.tech>2024-03-13 16:45:27 +0000
commita927b20ce1a6d5792ed41e0a98eb475606e8f35a (patch)
treeffc7df8c1108386a4865a80796861858d145a6a9 /cps-ncmp-rest
parent215b40aecaefdd8b523ea6ef72b14011adba3490 (diff)
Provide support for data producer identifier during registration (CPS-1964 1)
- Added support for the dataProducerIdentifier to be added, and updated from blank to something once - The dataProducerIdentifier is persisted in the DB Issue-ID: CPS-2105 Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech> Change-Id: I1c230be8f9402154a761e8c2ba4d8a6331965b3c
Diffstat (limited to 'cps-ncmp-rest')
-rw-r--r--cps-ncmp-rest/docs/openapi/components.yaml3
-rw-r--r--cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NcmpRestInputMapperSpec.groovy9
2 files changed, 8 insertions, 4 deletions
diff --git a/cps-ncmp-rest/docs/openapi/components.yaml b/cps-ncmp-rest/docs/openapi/components.yaml
index cd77effc8..635117c07 100644
--- a/cps-ncmp-rest/docs/openapi/components.yaml
+++ b/cps-ncmp-rest/docs/openapi/components.yaml
@@ -143,6 +143,9 @@ components:
alternateId:
type: string
example: "my-alternate-id"
+ dataProducerIdentifier:
+ type: string
+ example: "my-data-producer-identifier"
RestCmHandleProperties:
type: object
additionalProperties:
diff --git a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NcmpRestInputMapperSpec.groovy b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NcmpRestInputMapperSpec.groovy
index 0bc0c1e55..b5f61adc5 100644
--- a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NcmpRestInputMapperSpec.groovy
+++ b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NcmpRestInputMapperSpec.groovy
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2022-2023 Nordix Foundation
+ * Copyright (C) 2022-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.
@@ -41,7 +41,7 @@ class NcmpRestInputMapperSpec extends Specification {
def 'Convert a created REST CM Handle Input to an NCMP Service CM Handle with #scenario'() {
given: 'a rest cm handle input'
def inputRestCmHandle = new RestInputCmHandle(cmHandle : 'example-id', cmHandleProperties: registrationDmiProperties,
- publicCmHandleProperties: registrationPublicProperties, trustLevel: registrationTrustLevel, alternateId: 'my-alternate-id', moduleSetTag: 'my-module-set-tag')
+ publicCmHandleProperties: registrationPublicProperties, trustLevel: registrationTrustLevel, alternateId: 'my-alternate-id', moduleSetTag: 'my-module-set-tag', dataProducerIdentifier: 'my-data-producer-identifier')
def restDmiPluginRegistration = new RestDmiPluginRegistration(
createdCmHandles: [inputRestCmHandle])
when: 'to plugin dmi registration is called'
@@ -53,10 +53,11 @@ class NcmpRestInputMapperSpec extends Specification {
and: '(empty) properties are converted correctly'
result.createdCmHandles[0].dmiProperties == mappedDmiProperties
result.createdCmHandles[0].publicProperties == mappedPublicProperties
- result.createdCmHandles[0].registrationTrustLevel == mappedTrustLevel
- and: 'alternate ID and module set tag converted correctly'
+ and: 'other fields are mapped correctly'
result.createdCmHandles[0].alternateId == 'my-alternate-id'
result.createdCmHandles[0].moduleSetTag == 'my-module-set-tag'
+ result.createdCmHandles[0].registrationTrustLevel == mappedTrustLevel
+ result.createdCmHandles[0].dataProducerIdentifier == 'my-data-producer-identifier'
where: 'the following parameters are used'
scenario | registrationDmiProperties | registrationPublicProperties | registrationTrustLevel || mappedDmiProperties | mappedPublicProperties | mappedTrustLevel
'dmi and public properties' | ['Property-Example': 'example property'] | ['Public-Property-Example': 'public example property'] | 'COMPLETE' || ['Property-Example': 'example property'] | ['Public-Property-Example': 'public example property'] | TrustLevel.COMPLETE