diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-05-15 16:25:00 +0200 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-05-15 16:25:00 +0200 |
commit | da3a0ffd66b14e450f648bfe3737f3c933280087 (patch) | |
tree | 3ad092236a931d720c6fe16df6739eaa3ad7bdfe /aai-resources/src/main/java | |
parent | 13a082c7c8529612c7890e52e3e2b35024cf289f (diff) |
Do not use an exception to communicate an ok response in the /echo endpoint
- do not use an AAIException to return a 200 OK response
Issue-ID: AAI-3847
Change-Id: I29b20bb408fa55d5a18ab4e1981d7c2c435410a4
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'aai-resources/src/main/java')
-rw-r--r-- | aai-resources/src/main/java/org/onap/aai/rest/util/EchoResponse.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/aai-resources/src/main/java/org/onap/aai/rest/util/EchoResponse.java b/aai-resources/src/main/java/org/onap/aai/rest/util/EchoResponse.java index 745fb00..d4d8d32 100644 --- a/aai-resources/src/main/java/org/onap/aai/rest/util/EchoResponse.java +++ b/aai-resources/src/main/java/org/onap/aai/rest/util/EchoResponse.java @@ -56,6 +56,8 @@ public class EchoResponse extends RESTAPI { private static final String CHECK_DB_STATUS_NOW_ACTION = "checkDBNow"; + private static final String UP_RESPONSE="{\"status\":\"UP\",\"groups\":[\"liveness\",\"readiness\"]}"; + private final AaiGraphChecker aaiGraphChecker; public EchoResponse(AaiGraphChecker aaiGraphChecker) { @@ -101,7 +103,7 @@ public class EchoResponse extends RESTAPI { || CHECK_DB_STATUS_NOW_ACTION.equalsIgnoreCase(myAction)) { validateDBStatus(myAction); } - return generateSuccessResponse(headers, templateVars); + return generateSuccessResponse(); } catch (AAIException aaiException) { LOGGER.error("Error while processing echo request ", aaiException); @@ -136,11 +138,9 @@ public class EchoResponse extends RESTAPI { } - private Response generateSuccessResponse(HttpHeaders headers, ArrayList<String> templateVariables) { - HashMap<AAIException, ArrayList<String>> exceptionList = new HashMap<>(); - exceptionList.put(new AAIException("AAI_0002", "OK"), templateVariables); + private Response generateSuccessResponse() { return Response.status(Status.OK) - .entity(ErrorLogHelper.getRESTAPIInfoResponse(new ArrayList<>(headers.getAcceptableMediaTypes()), exceptionList)) + .entity(UP_RESPONSE) .build(); } |