diff options
Diffstat (limited to 'integration-test/src')
2 files changed, 28 insertions, 0 deletions
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 0b0e33c6f6..5ce2475d7d 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 @@ -95,6 +95,10 @@ class DmiDispatcher extends Dispatcher { case ~'^/dmi/v1/writeJob/(.*)$': return mockWriteJobResponse(request) + // get data job status + case ~'^/dmi/v1/dataJob/(.*)/dataProducerJob/(.*)/status(.*)$': + return mockResponseWithBody(HttpStatus.OK, '{"status":"status details from mock service"}') + default: throw new IllegalArgumentException('Mock DMI does not implement endpoint ' + request.path) } diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/DataJobStatusServiceSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/DataJobStatusServiceSpec.groovy new file mode 100644 index 0000000000..fdcad2b47b --- /dev/null +++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/DataJobStatusServiceSpec.groovy @@ -0,0 +1,24 @@ +package org.onap.cps.integration.functional.ncmp + +import org.onap.cps.integration.base.CpsIntegrationSpecBase +import org.onap.cps.ncmp.api.datajobs.DataJobStatusService +import org.springframework.beans.factory.annotation.Autowired + +class DataJobStatusServiceSpec extends CpsIntegrationSpecBase { + + @Autowired + DataJobStatusService dataJobStatusService + + def 'Get the status of a data job from DMI.'() { + given: 'the required data about the data job' + def dmiServiceName = DMI1_URL + def requestId = 'some-request-id' + def dataProducerJobId = 'some-data-producer-job-id' + def dataProducerId = 'some-data-producer-id' + def authorization = 'my authorization header' + when: 'the data job status checked' + def result = dataJobStatusService.getDataJobStatus(authorization, dmiServiceName, requestId, dataProducerJobId, dataProducerId) + then: 'the status is that defined in the mock service.' + assert result == 'status details from mock service' + } +} |