diff options
-rw-r--r-- | aai-resources/src/main/java/org/onap/aai/rest/util/EchoResponse.java | 10 | ||||
-rw-r--r-- | aai-resources/src/test/java/org/onap/aai/rest/util/EchoResponseTest.java | 11 |
2 files changed, 5 insertions, 16 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(); } diff --git a/aai-resources/src/test/java/org/onap/aai/rest/util/EchoResponseTest.java b/aai-resources/src/test/java/org/onap/aai/rest/util/EchoResponseTest.java index f754449..030e870 100644 --- a/aai-resources/src/test/java/org/onap/aai/rest/util/EchoResponseTest.java +++ b/aai-resources/src/test/java/org/onap/aai/rest/util/EchoResponseTest.java @@ -124,17 +124,6 @@ public class EchoResponseTest extends AAISetup { } @Test - public void testEchoResultWhenValidHeadersButMediaTypeWrong() { - - when(httpHeaders.getAcceptableMediaTypes()).thenThrow(new IllegalStateException()).thenReturn(outputMediaTypes); - - Response response = echoResponse.echoResult(httpHeaders, null, ""); - - assertNotNull(response); - assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), response.getStatus()); - } - - @Test public void testCheckDbAction_CachedSuccess() { // Prepare when(aaiGraphCheckerMock.isAaiGraphDbAvailable(CheckerType.CACHED)).thenReturn(Boolean.TRUE); |