diff options
author | 2025-01-13 10:16:34 +0000 | |
---|---|---|
committer | 2025-01-29 15:03:49 +0000 | |
commit | 4f72ab6fe7d81a350616bb54e195b19c63a898e7 (patch) | |
tree | 09e35aae99aec9b209fced5af196561909337b3d /integration-test | |
parent | 14745d17d3e751ead0817bfbc42acf5ee45e627f (diff) |
Add "dataProducerId" and "dmiServiceName" values to SubJobWriteResponse in sendRequestsToDmi method
- DMI call only returns subJobId
- SubJobWriteResponse created using DMI response and request values
Issue-ID: CPS-2497
Change-Id: Ib38132f2337de6a12b0b05bc6eebeed99f8d435d
Signed-off-by: egernug <gerard.nugent@est.tech>
Diffstat (limited to 'integration-test')
3 files changed, 7 insertions, 7 deletions
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/base/CpsIntegrationSpecBase.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/base/CpsIntegrationSpecBase.groovy index f3cca801e7..b9b1c162e7 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/base/CpsIntegrationSpecBase.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/base/CpsIntegrationSpecBase.groovy @@ -260,7 +260,7 @@ abstract class CpsIntegrationSpecBase extends Specification { } def registerCmHandleWithoutWaitForReady(dmiPlugin, cmHandleId, moduleSetTag, alternateId) { - def cmHandleToCreate = new NcmpServiceCmHandle(cmHandleId: cmHandleId, moduleSetTag: moduleSetTag, alternateId: alternateId) + def cmHandleToCreate = new NcmpServiceCmHandle(cmHandleId: cmHandleId, moduleSetTag: moduleSetTag, alternateId: alternateId, dataProducerIdentifier: 'some data producer id') networkCmProxyInventoryFacade.updateDmiRegistration(new DmiPluginRegistration(dmiPlugin: dmiPlugin, createdCmHandles: [cmHandleToCreate])) } diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/base/DmiDispatcher.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/base/DmiDispatcher.groovy index 35a7b6a7c2..c790521627 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/base/DmiDispatcher.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/base/DmiDispatcher.groovy @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. @@ -113,7 +113,7 @@ class DmiDispatcher extends Dispatcher { def destination = Matcher.lastMatcher[0][1] def subJobWriteRequest = jsonSlurper.parseText(request.getBody().readUtf8()) this.receivedSubJobs.put(destination, subJobWriteRequest) - def response = '{"subJobId":"some sub job id", "dmiServiceName":"some dmi service name", "dataProducerId":"some data producer id"}' + def response = '{"subJobId":"some sub job id"}' return mockResponseWithBody(HttpStatus.OK, response) } diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/WriteSubJobSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/WriteSubJobSpec.groovy index 834e1399e3..5d3ea1919a 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/WriteSubJobSpec.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/WriteSubJobSpec.groovy @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2024 Nordix Foundation + * Copyright (C) 2024-2025 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. @@ -59,9 +59,9 @@ class WriteSubJobSpec extends CpsIntegrationSpecBase { then: 'each DMI received the expected sub-jobs and the response has the expected values' assert response.size() == 2 assert response[0].class == SubJobWriteResponse.class - assert response[0].subJobId == "some sub job id" - assert response[0].dmiServiceName == "some dmi service name" - assert response[0].dataProducerId == "some data producer id" + assert response[0].subJobId == 'some sub job id' + assert response[0].dmiServiceName.startsWith('http://localhost:') + assert response[0].dataProducerId == 'some data producer id' and: 'dmi 1 received the correct job details' def receivedSubJobsForDispatcher1 = dmiDispatcher1.receivedSubJobs['?destination=d1']['data'].collect() assert receivedSubJobsForDispatcher1.size() == 2 |