diff options
author | leventecsanyi <levente.csanyi@est.tech> | 2024-08-08 16:21:07 +0200 |
---|---|---|
committer | leventecsanyi <levente.csanyi@est.tech> | 2024-08-13 14:18:04 +0200 |
commit | e31db7316963f7554c493c1e65ff21df37f8f0b2 (patch) | |
tree | a07d7a4e6a19bb5d99fc1856e09eca515294714f /cps-ncmp-service/src/test | |
parent | d3c1e7246ab4f41cf3dad97e559ca2736b0014cf (diff) |
Refactored Data Job interfaces
-modified writejob & status endpoints
Issue-ID: CPS-2360
Change-Id: I87647f59493886593825f5175c6ed708e55b3e30
Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
Diffstat (limited to 'cps-ncmp-service/src/test')
2 files changed, 4 insertions, 5 deletions
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/datajobs/DataJobStatusServiceImplSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/datajobs/DataJobStatusServiceImplSpec.groovy index cc042988f6..d231dfa755 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/datajobs/DataJobStatusServiceImplSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/datajobs/DataJobStatusServiceImplSpec.groovy @@ -39,15 +39,14 @@ class DataJobStatusServiceImplSpec extends Specification { def 'Forward a data job status query to DMI.' () { given: 'the required parameters for querying' def dmiServiceName = 'some-dmi-service' - def requestId = 'some-request-id' + def dataProducerId = 'some-data-producer-id' def dataProducerJobId = 'some-data-producer-job-id' - def dataJobId = 'some-data-job-id' def authorization = 'my authorization header' - def urlParams = new UrlTemplateParameters('some-dmi-service/dmi/v1/dataJob/{requestId}/dataProducerJob/{dataProducerJobId}/status?dataProducerId={dataProducerId}', ['dataProducerJobId':'some-data-producer-job-id', 'dataProducerId':'some-data-job-id', 'requestId':'some-request-id']) + def urlParams = new UrlTemplateParameters('some-dmi-service/dmi/v1/cmwriteJob/dataProducer/{dataProducerId}/dataProducerJob/{dataProducerJobId}/status', ['dataProducerId':'some-data-producer-id', 'dataProducerJobId':'some-data-producer-job-id']) and: 'the rest client returns a status for the given parameters' mockDmiRestClient.getDataJobStatus(urlParams, authorization) >> Mono.just('some status') when: 'the job status is queried' - def status = objectUnderTest.getDataJobStatus(authorization, dmiServiceName, requestId, dataProducerJobId, dataJobId) + def status = objectUnderTest.getDataJobStatus(authorization, dmiServiceName, dataProducerId, dataProducerJobId) then: 'the status from the rest client is returned' assert status == 'some status' } diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/datajobs/DmiSubJobRequestHandlerSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/datajobs/DmiSubJobRequestHandlerSpec.groovy index b3dd02dec3..041fbd95ee 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/datajobs/DmiSubJobRequestHandlerSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/datajobs/DmiSubJobRequestHandlerSpec.groovy @@ -30,7 +30,7 @@ class DmiSubJobRequestHandlerSpec extends Specification { def authorization = 'my authorization header' and: 'the dmi rest client will return a response (for the correct parameters)' def responseEntity = new ResponseEntity<>(new SubJobWriteResponse('my-sub-job-id', 'dmi1', 'prod1'), HttpStatus.OK) - def expectedJson = '{"dataAcceptType":"t1","dataContentType":"t2","dataProducerId":"prod1","data":[{"path":"p","op":"operation","moduleSetTag":"tag","value":null,"operationId":"o1","privateProperties":{}}]}' + def expectedJson = '{"destination":"d1","dataAcceptType":"t1","dataContentType":"t2","dataProducerId":"prod1","dataJobId":"some-job-id","data":[{"path":"p","op":"operation","moduleSetTag":"tag","value":null,"operationId":"o1","privateProperties":{}}]}' mockDmiRestClient.synchronousPostOperationWithJsonData(RequiredDmiService.DATA, _, expectedJson, OperationType.CREATE, authorization) >> responseEntity when: 'sending request to DMI invoked' objectUnderTest.sendRequestsToDmi(authorization, dataJobId, dataJobMetadata, dmiWriteOperationsPerProducerKey) |