162b51844c594ddd7ce2da867ab76118a0cb8c34
[cps.git] /
1 package org.onap.cps.integration.functional.ncmp
2
3 import org.onap.cps.integration.base.CpsIntegrationSpecBase
4 import org.onap.cps.ncmp.api.datajobs.DataJobStatusService
5 import org.springframework.beans.factory.annotation.Autowired
6
7 class DataJobStatusServiceSpec extends CpsIntegrationSpecBase {
8
9     @Autowired
10     DataJobStatusService dataJobStatusService
11
12     def 'Get the status of a data job from DMI.'() {
13         given: 'the required data about the data job'
14             def dmiServiceName = DMI1_URL
15             def dataProducerId = 'some-data-producer-id'
16             def dataProducerJobId = 'some-data-producer-job-id'
17             def authorization = 'my authorization header'
18         when: 'the data job status checked'
19             def result = dataJobStatusService.getDataJobStatus(authorization, dmiServiceName, dataProducerId, dataProducerJobId)
20         then: 'the status is that defined in the mock service.'
21             assert result == '{"status":"status details from mock service"}'
22     }
23 }