summaryrefslogtreecommitdiffstats
path: root/appc-adapters/appc-rest-adapter/appc-rest-adapter-bundle/src/main
diff options
context:
space:
mode:
authorGanesh Chandrasekaran <ganesh.c@samsung.com>2018-08-30 17:55:34 +0900
committerTakamune Cho <tc012c@att.com>2018-09-05 17:52:13 +0000
commit726d7d621d21215e3822a31fbbc8a6091d7697ea (patch)
tree01c4fc9df944d2540ea4045a5788e576f567bf24 /appc-adapters/appc-rest-adapter/appc-rest-adapter-bundle/src/main
parent875d836aeff308645ce59daf0ca59b77e0f13940 (diff)
refactor restAdaptor and add test for HTTP-PUT
Issue-ID: APPC-1181 Change-Id: Ibd70b03db906343c5e9c27439e2da541a54672e2 Signed-off-by: Ganesh Chandrasekaran <ganesh.c@samsung.com>
Diffstat (limited to 'appc-adapters/appc-rest-adapter/appc-rest-adapter-bundle/src/main')
-rw-r--r--appc-adapters/appc-rest-adapter/appc-rest-adapter-bundle/src/main/java/org/onap/appc/adapter/rest/impl/RestAdapterImpl.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/appc-adapters/appc-rest-adapter/appc-rest-adapter-bundle/src/main/java/org/onap/appc/adapter/rest/impl/RestAdapterImpl.java b/appc-adapters/appc-rest-adapter/appc-rest-adapter-bundle/src/main/java/org/onap/appc/adapter/rest/impl/RestAdapterImpl.java
index 7f9f84345..39fdb1b6c 100644
--- a/appc-adapters/appc-rest-adapter/appc-rest-adapter-bundle/src/main/java/org/onap/appc/adapter/rest/impl/RestAdapterImpl.java
+++ b/appc-adapters/appc-rest-adapter/appc-rest-adapter-bundle/src/main/java/org/onap/appc/adapter/rest/impl/RestAdapterImpl.java
@@ -6,6 +6,8 @@
* ================================================================================
* Copyright (C) 2017 Amdocs
* =============================================================================
+ * Modifications Copyright (C) 2018 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -156,8 +158,8 @@ public class RestAdapterImpl implements RestAdapter {
svcLogic.setStatus(OUTCOME_FAILURE);
svcLogic.setAttribute(Constants.ATTRIBUTE_ERROR_CODE, status);
svcLogic.setAttribute(Constants.ATTRIBUTE_ERROR_MESSAGE, msg);
- svcLogic.setAttribute("org.openecomp.rest.result.code", status);
- svcLogic.setAttribute("org.openecomp.rest.result.message", msg);
+ svcLogic.setAttribute(Constants.CONTEXT_ERROR_CODE, status);
+ svcLogic.setAttribute(Constants.CONTEXT_ERROR_MESSAGE, msg);
}
@@ -170,9 +172,9 @@ public class RestAdapterImpl implements RestAdapter {
svcLogic.setStatus(OUTCOME_SUCCESS);
svcLogic.setAttribute(Constants.ATTRIBUTE_ERROR_CODE, Integer.toString(HttpStatus.OK_200.getStatusCode()));
svcLogic.setAttribute(Constants.ATTRIBUTE_ERROR_MESSAGE, message);
- svcLogic.setAttribute("org.openecomp.rest.agent.result.code", Integer.toString(code));
- svcLogic.setAttribute("org.openecomp.rest.agent.result.message", message);
- svcLogic.setAttribute("org.openecomp.rest.result.code", Integer.toString(HttpStatus.OK_200.getStatusCode()));
+ svcLogic.setAttribute(Constants.CONTEXT_AGENT_ERROR_CODE, Integer.toString(code));
+ svcLogic.setAttribute(Constants.CONTEXT_AGENT_ERROR_MESSAGE, message);
+ svcLogic.setAttribute(Constants.CONTEXT_ERROR_CODE, Integer.toString(HttpStatus.OK_200.getStatusCode()));
}
private void executeHttpRequest(HttpRequestBase httpRequest, RequestContext rc) {