diff options
author | sourabh_sourabh <sourabh.sourabh@est.tech> | 2022-03-12 22:41:10 +0530 |
---|---|---|
committer | sourabh_sourabh <sourabh.sourabh@est.tech> | 2022-03-14 22:46:19 +0530 |
commit | e1f41c3e6591b572a75021f4b51538f8fdbfc88d (patch) | |
tree | 24dbad0eba106783b3a4483345b4197d99e0b9cc /cps-ncmp-rest | |
parent | 7c98a26620b424d7328b57e0aeedd634cdeeb564 (diff) |
Async: NCMP Rest impl. including Request ID generation
- In case of invalid topic return http status 400 with error message
- Unit test is modified to handle/validate InvalidTopicException
Issue-ID: CPS-828
Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
Change-Id: I05645c92ccebb8aa422a47f6edcde7b64088a118
Diffstat (limited to 'cps-ncmp-rest')
-rwxr-xr-x | cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/exceptions/NetworkCmProxyRestExceptionHandler.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/exceptions/NetworkCmProxyRestExceptionHandler.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/exceptions/NetworkCmProxyRestExceptionHandler.java index 2495f36426..0843e9741e 100755 --- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/exceptions/NetworkCmProxyRestExceptionHandler.java +++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/exceptions/NetworkCmProxyRestExceptionHandler.java @@ -24,6 +24,7 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.onap.cps.ncmp.api.impl.exception.DmiRequestException; +import org.onap.cps.ncmp.api.impl.exception.InvalidTopicException; import org.onap.cps.ncmp.api.impl.exception.NcmpException; import org.onap.cps.ncmp.api.impl.exception.ServerNcmpException; import org.onap.cps.ncmp.rest.controller.NetworkCmProxyController; @@ -65,7 +66,8 @@ public class NetworkCmProxyRestExceptionHandler { return buildErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR, exception); } - @ExceptionHandler({DmiRequestException.class, DataValidationException.class, HttpMessageNotReadableException.class}) + @ExceptionHandler({DmiRequestException.class, DataValidationException.class, HttpMessageNotReadableException.class, + InvalidTopicException.class}) public static ResponseEntity<Object> handleDmiRequestExceptions(final Exception exception) { return buildErrorResponse(HttpStatus.BAD_REQUEST, exception); } |