From b130fd3158c537df1ce2cb1e5a7a86c3d7e0d2a7 Mon Sep 17 00:00:00 2001 From: DylanB95EST Date: Mon, 4 Apr 2022 13:09:22 +0100 Subject: Refactoring/ Adding Tests for Validation Refactored classes affected by validation Have added tests for anywhere where validation is used Have refactored the parse and sync modules validation to be validated at the public api method Issue-ID: CPS-322 Change-Id: I4989cfd03300fbdca41571d0aa2d0b96978858ba Signed-off-by: DylanB95EST --- .../org/onap/cps/ncmp/rest/controller/NcmpRestInputMapperSpec.groovy | 2 +- .../onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller') 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 3d54a0b08..bb762080d 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 @@ -43,7 +43,7 @@ class NcmpRestInputMapperSpec extends Specification { then: 'the result returns the correct number of cm handles' result.createdCmHandles.size() == 1 and: 'the converted cm handle has the same id' - result.createdCmHandles[0].cmHandleID == 'example-id' + result.createdCmHandles[0].cmHandleId == 'example-id' and: '(empty) properties are converted correctly' result.createdCmHandles[0].dmiProperties == expectedDmiProperties result.createdCmHandles[0].publicProperties == expectedPublicProperties diff --git a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy index efe0f3ae6..b34b0fff3 100644 --- a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy +++ b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy @@ -231,7 +231,7 @@ class NetworkCmProxyControllerSpec extends Specification { def cmHandleId = 'Some-Cm-Handle' def dmiProperties = [ prop:'some DMI property' ] def publicProperties = [ "public prop":'some public property' ] - def ncmpServiceCmHandle = new NcmpServiceCmHandle(cmHandleID: cmHandleId, dmiProperties: dmiProperties, publicProperties: publicProperties) + def ncmpServiceCmHandle = new NcmpServiceCmHandle(cmHandleId: cmHandleId, dmiProperties: dmiProperties, publicProperties: publicProperties) and: 'the service method is invoked with the cm handle id' 1 * mockNetworkCmProxyDataService.getNcmpServiceCmHandle('Some-Cm-Handle') >> ncmpServiceCmHandle when: 'the cm handle details api is invoked' -- cgit 1.2.3-korg