Skip to content

Commit

Permalink
Fixing issue in event subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashi1993 committed Oct 13, 2023
1 parent 916abae commit 2b4fa90
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import net.minidev.json.parser.JSONParser;
import net.minidev.json.parser.ParseException;
import org.apache.commons.io.IOUtils;
import org.eclipse.jetty.http.HttpStatus;
import org.springframework.http.HttpStatus;

import java.io.IOException;

Expand Down Expand Up @@ -76,7 +76,7 @@ public static JSONObject getJSONObjectPayload(HttpServletRequest request) throws
*/
public static Response mapEventSubscriptionServiceResponse(EventSubscriptionResponse eventSubscriptionResponse) {
int status = eventSubscriptionResponse.getStatus();
if (HttpStatus.NO_CONTENT_204 == status) {
if (HttpStatus.NO_CONTENT.value() == status) {
return Response.status(status)
.build();
} else if (eventSubscriptionResponse.getErrorResponse() == null) {
Expand All @@ -85,7 +85,7 @@ public static Response mapEventSubscriptionServiceResponse(EventSubscriptionResp
.entity(eventSubscriptionResponse.getResponseBody())
.build();
} else {
return Response.status(HttpStatus.INTERNAL_SERVER_ERROR_500)
return Response.status(HttpStatus.INTERNAL_SERVER_ERROR.value())
.entity(EventNotificationServiceUtil.getErrorDTO(EventNotificationConstants.INVALID_REQUEST,
EventNotificationConstants.ERROR_HANDLING_EVENT_SUBSCRIPTION))
.build();
Expand Down

0 comments on commit 2b4fa90

Please sign in to comment.