diff options
author | DylanB95EST <dylan.byrne@est.tech> | 2022-01-27 17:12:52 +0000 |
---|---|---|
committer | Dylan Byrne <dylan.byrne@est.tech> | 2022-03-01 16:17:16 +0000 |
commit | e557338803286d8aaa0f877aa25d52d18735f309 (patch) | |
tree | 059b68301b3e6c34d8bb68a8cb7dadf6bed45a06 /cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/exceptions | |
parent | 03459a08895ecc7e481fc5ec34779556268992f1 (diff) |
Create Endpoint For Get Cm Handles By Name
Create endpoint and implement logic for
get cm handle details by cm handle name
Issue-ID: CPS-817
Change-Id: I83bd2da9219d13fac715a08b19108028ca6f6751
Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
Diffstat (limited to 'cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/exceptions')
-rw-r--r-- | cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/exceptions/NetworkCmProxyRestExceptionHandlerSpec.groovy | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/exceptions/NetworkCmProxyRestExceptionHandlerSpec.groovy b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/exceptions/NetworkCmProxyRestExceptionHandlerSpec.groovy index 306f546f32..8004328bc2 100644 --- a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/exceptions/NetworkCmProxyRestExceptionHandlerSpec.groovy +++ b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/exceptions/NetworkCmProxyRestExceptionHandlerSpec.groovy @@ -29,6 +29,7 @@ import org.onap.cps.ncmp.api.impl.exception.DmiRequestException import org.onap.cps.ncmp.api.impl.exception.ServerNcmpException import org.onap.cps.ncmp.rest.controller.RestInputMapper import org.onap.cps.spi.exceptions.CpsException +import org.onap.cps.spi.exceptions.DataNodeNotFoundException import org.onap.cps.spi.exceptions.DataValidationException import org.onap.cps.utils.JsonObjectMapper import org.spockframework.spring.SpringBean @@ -78,6 +79,8 @@ class NetworkCmProxyRestExceptionHandlerSpec extends Specification { def errorMessage = 'some error message' @Shared def errorDetails = 'some error details' + @Shared + def dataNodeNotFoundErrorMessage = 'DataNode not found' def setup() { dataNodeBaseEndpointNcmp = "$basePathNcmp/v1" @@ -89,13 +92,14 @@ class NetworkCmProxyRestExceptionHandlerSpec extends Specification { setupTestException(exception, NCMP) def response = performTestRequest(NCMP) then: 'an HTTP response is returned with correct message and details' - assertTestResponse(response, expectedErrorCode, errorMessage, expectedErrorDetails) + assertTestResponse(response, expectedErrorCode, expectedErrorMessage, expectedErrorDetails) where: - scenario | exception || expectedErrorDetails | expectedErrorCode - 'CPS' | new CpsException(errorMessage, errorDetails) || errorDetails | INTERNAL_SERVER_ERROR - 'NCMP-server' | new ServerNcmpException(errorMessage, errorDetails) || null | INTERNAL_SERVER_ERROR - 'NCMP-client' | new DmiRequestException(errorMessage, errorDetails) || null | BAD_REQUEST - 'other' | new IllegalStateException(errorMessage) || null | INTERNAL_SERVER_ERROR + scenario | exception || expectedErrorDetails | expectedErrorMessage | expectedErrorCode + 'CPS' | new CpsException(errorMessage, errorDetails) || errorDetails | errorMessage | INTERNAL_SERVER_ERROR + 'NCMP-server' | new ServerNcmpException(errorMessage, errorDetails) || null | errorMessage | INTERNAL_SERVER_ERROR + 'NCMP-client' | new DmiRequestException(errorMessage, errorDetails) || null | errorMessage | BAD_REQUEST + 'DataNode Validation' | new DataNodeNotFoundException(dataNodeNotFoundErrorMessage, errorDetails) || null | dataNodeNotFoundErrorMessage | BAD_REQUEST + 'other' | new IllegalStateException(errorMessage) || null | errorMessage | INTERNAL_SERVER_ERROR } def 'Post request with exception returns correct HTTP Status.'() { |