diff options
author | leventecsanyi <levente.csanyi@est.tech> | 2024-07-24 15:42:32 +0200 |
---|---|---|
committer | leventecsanyi <levente.csanyi@est.tech> | 2024-07-25 17:39:52 +0200 |
commit | 7f49c706b6fba519d34099b08450b884d53c798b (patch) | |
tree | 567832a5b528978f28b9629df9641021f56ed241 /dmi-service/src/test/groovy | |
parent | 477405c7b9e86061cdc674efb882293a18182606 (diff) |
Added REST endpoint for data job status
- extended opanapi
- added not-implemented http error for new endpoint
- added testware
Issue-ID: CPS-2295
Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
Change-Id: Ib7aa90da2ec53dd523740ad267919fd2e709e937
Diffstat (limited to 'dmi-service/src/test/groovy')
-rw-r--r-- | dmi-service/src/test/groovy/org/onap/cps/ncmp/dmi/datajobs/rest/controller/DmiDatajobsRestControllerSpec.groovy | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/dmi-service/src/test/groovy/org/onap/cps/ncmp/dmi/datajobs/rest/controller/DmiDatajobsRestControllerSpec.groovy b/dmi-service/src/test/groovy/org/onap/cps/ncmp/dmi/datajobs/rest/controller/DmiDatajobsRestControllerSpec.groovy index c55f53c1..69d2ebd2 100644 --- a/dmi-service/src/test/groovy/org/onap/cps/ncmp/dmi/datajobs/rest/controller/DmiDatajobsRestControllerSpec.groovy +++ b/dmi-service/src/test/groovy/org/onap/cps/ncmp/dmi/datajobs/rest/controller/DmiDatajobsRestControllerSpec.groovy @@ -30,6 +30,7 @@ import org.springframework.security.test.context.support.WithMockUser import org.springframework.test.web.servlet.MockMvc import spock.lang.Specification +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post @Import(WebSecurityConfig) @@ -66,4 +67,16 @@ class DmiDatajobsRestControllerSpec extends Specification{ then: 'response value is Not Implemented' response.status == HttpStatus.NOT_IMPLEMENTED.value() } + + def 'get status request should return 501 HTTP Status' () { + given: 'URL to get the status of a data job' + def getStatus = "${basePathV1}/dataJob/some-identifier/dataProducerJob/some-producer-job-identifier/status?dataProducerId=some-data-producer-identifier" + when: 'the request is performed' + def response = mvc.perform( + get(getStatus) + .contentType('application/json') + ).andReturn().response + then: 'response value is Not Implemented' + response.status == HttpStatus.NOT_IMPLEMENTED.value() + } } |