From b53a57901dd73270a4389109b0df8ca5c02a9e22 Mon Sep 17 00:00:00 2001 From: tragait Date: Thu, 2 Sep 2021 12:32:35 +0100 Subject: fix data type as string for dmi request body Issue-ID: CPS-634 Signed-off-by: tragait Change-Id: Ib3d9d7cab12c77332d799b89e73e5a9b934a4473 --- .../org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy | 2 +- src/test/groovy/org/onap/cps/ncmp/dmi/service/DmiServiceImplSpec.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/test/groovy') diff --git a/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy b/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy index e08870fd..c32608c0 100644 --- a/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy +++ b/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy @@ -212,7 +212,7 @@ class DmiRestControllerSpec extends Specification { def writeDataforCmHandlePassthroughRunning = "${basePathV1}/ch/some-cmHandle/data/ds/ncmp-datastore:passthrough-running/some-resourceIdentifier" def jsonData = TestUtils.getResourceFileContent('WriteDataForCmHandle.json') and: 'dmi service is called' - mockDmiService.writeResourceDataPassthroughForCmHandle('some-cmHandle', 'some-resourceIdentifier', 'application/json', ['some-data': 'some-value']) >> '{some-json}' + mockDmiService.writeResourceDataPassthroughForCmHandle('some-cmHandle', 'some-resourceIdentifier', 'application/json', '{ some data }') >> '{some-json}' when: 'write cmHandle passthrough running post api is invoked with json data' def response = mvc.perform( post(writeDataforCmHandlePassthroughRunning).contentType(MediaType.APPLICATION_JSON) diff --git a/src/test/groovy/org/onap/cps/ncmp/dmi/service/DmiServiceImplSpec.groovy b/src/test/groovy/org/onap/cps/ncmp/dmi/service/DmiServiceImplSpec.groovy index 1d2cf7f3..7891450d 100644 --- a/src/test/groovy/org/onap/cps/ncmp/dmi/service/DmiServiceImplSpec.groovy +++ b/src/test/groovy/org/onap/cps/ncmp/dmi/service/DmiServiceImplSpec.groovy @@ -266,7 +266,7 @@ class DmiServiceImplSpec extends Specification { mockObjectMapper.writeValueAsString(_) >> jsonString when: 'write resource data for pass through method is invoked' objectUnderTest.writeResourceDataPassthroughForCmHandle('some-cmHandle', - 'some-resourceIdentifier', 'some-dataType', new Object()) + 'some-resourceIdentifier', 'some-dataType', 'some-json-data') then: 'a dmi exception is thrown' thrown(DmiException.class) where: 'the following combinations are tested' -- cgit 1.2.3-korg