summaryrefslogtreecommitdiffstats
path: root/integration-test/src
diff options
context:
space:
mode:
authorleventecsanyi <levente.csanyi@est.tech>2024-07-08 17:33:16 +0200
committerLevente Csanyi <levente.csanyi@est.tech>2024-07-25 13:11:00 +0000
commit9864d3f58694f07a35b34ee651fbaf51d993fdd6 (patch)
tree34dbd863191420f0928735aee183ff72d03ceef9 /integration-test/src
parentdc56d427e0c1f3161d752bd6078b31529c5469d8 (diff)
Get data job status from DMI Plugin
- added java interface - extended DmiRestClient to get data job status - added testware Issue-ID: CPS-2296 Change-Id: If9006bba06397724c15bdc3bdf1bd52a0188f002 Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
Diffstat (limited to 'integration-test/src')
-rw-r--r--integration-test/src/test/groovy/org/onap/cps/integration/base/DmiDispatcher.groovy4
-rw-r--r--integration-test/src/test/groovy/org/onap/cps/integration/functional/ncmp/DataJobStatusServiceSpec.groovy24
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'
+ }
+}