Bugfix: Blueprints Processor always return 200 OK 75/87875/1
authorottero <rodrigo.ottero@est.tech>
Thu, 16 May 2019 09:00:07 +0000 (09:00 +0000)
committerDan Timoney <dtimoney@att.com>
Thu, 16 May 2019 13:22:34 +0000 (13:22 +0000)
commitf12439e7511703bd7120cd29cdf1934d2bb7eca8
tree3b1503857c7bc46f647d712d9f5f75bf946a3f77
parentd5a428efae211b281caeffe1cec9eaa34b92ecb9
Bugfix: Blueprints Processor always return 200 OK

Currently the Blueprints Processor mS replies with a 200 OK HTTP status
code even if an exception occurs in the server side while executing the
request.

Thus, the only way for a REST client to determine if the request was
successful or not is by analysing the response and evaluate the
content of the element status.code

This bugfix modifies the HTTP status code of the response to match the
one inside the response.

Issue-ID: CCSDK-1327
Change-Id: I05a58cb3ab9359319172f2d8f1a665fdcdc1230b
Signed-off-by: ottero <rodrigo.ottero@est.tech>
(cherry picked from commit 5801ed7abaa58f7ef728ad68c496a3780d438194)
ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceController.kt
ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/utils/Utils.kt
ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceHandlerTest.kt
ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/utils/Utils.kt [new file with mode: 0644]
ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/execution-input/faulty-input.json [new file with mode: 0644]