Update rest return parameters 38/77738/2
authorPatrick Brady <patrick.brady@att.com>
Fri, 1 Feb 2019 20:18:10 +0000 (12:18 -0800)
committerTakamune Cho <takamune.cho@att.com>
Fri, 1 Feb 2019 21:50:14 +0000 (21:50 +0000)
Change-Id: If5d860a37a87ac0feb6452173cf147bbafa079b3
Signed-off-by: Patrick Brady <patrick.brady@att.com>
Issue-ID: APPC-1381

appc-adapters/appc-rest-adapter/appc-rest-adapter-bundle/src/test/java/org/onap/appc/adapter/rest/impl/TestRestAdapterImpl.java
appc-core/appc-common-bundle/src/main/java/org/onap/appc/Constants.java

index b4c96d5..f056ceb 100644 (file)
@@ -91,9 +91,9 @@ public class TestRestAdapterImpl {
         adapter.commonGet(params, ctx);
 
         assertEquals("failure", ctx.getStatus());
-        assertEquals("500", ctx.getAttribute("org.openecomp.rest.result.code"));
+        assertEquals("500", ctx.getAttribute("org.onap.rest.result.code"));
         assertEquals("java.lang.IllegalArgumentException: HTTP request may not be null",
-                     ctx.getAttribute("org.openecomp.rest.result.message"));
+                     ctx.getAttribute("org.onap.rest.result.message"));
     }
 
     @Test
@@ -109,9 +109,9 @@ public class TestRestAdapterImpl {
         adapter.commonGet(params, ctx);
 
         assertEquals("failure", ctx.getStatus());
-        assertEquals("500", ctx.getAttribute("org.openecomp.rest.result.code"));
+        assertEquals("500", ctx.getAttribute("org.onap.rest.result.code"));
         assertEquals("org.apache.http.client.ClientProtocolException",
-                     ctx.getAttribute("org.openecomp.rest.result.message"));
+                     ctx.getAttribute("org.onap.rest.result.message"));
     }
     
     @Test
@@ -140,9 +140,9 @@ public class TestRestAdapterImpl {
         adapter.commonPost(params, ctx);
 
         assertEquals("failure", ctx.getStatus());
-        assertEquals("500", ctx.getAttribute("org.openecomp.rest.result.code"));
+        assertEquals("500", ctx.getAttribute("org.onap.rest.result.code"));
         assertEquals("java.lang.IllegalArgumentException: HTTP request may not be null",
-                     ctx.getAttribute("org.openecomp.rest.result.message"));
+                     ctx.getAttribute("org.onap.rest.result.message"));
     }
 
     @Test
@@ -158,9 +158,9 @@ public class TestRestAdapterImpl {
         adapter.commonPost(params, ctx);
 
         assertEquals("failure", ctx.getStatus());
-        assertEquals("500", ctx.getAttribute("org.openecomp.rest.result.code"));
+        assertEquals("500", ctx.getAttribute("org.onap.rest.result.code"));
         assertEquals("org.apache.http.client.ClientProtocolException",
-                     ctx.getAttribute("org.openecomp.rest.result.message"));
+                     ctx.getAttribute("org.onap.rest.result.message"));
     }
     
     @Test
@@ -190,9 +190,9 @@ public class TestRestAdapterImpl {
         adapter.commonPut(params, ctx);
 
         assertEquals("failure", ctx.getStatus());
-        assertEquals("500", ctx.getAttribute("org.openecomp.rest.result.code"));
+        assertEquals("500", ctx.getAttribute("org.onap.rest.result.code"));
         assertEquals("java.lang.IllegalArgumentException: HTTP request may not be null",
-                     ctx.getAttribute("org.openecomp.rest.result.message"));
+                     ctx.getAttribute("org.onap.rest.result.message"));
     }
 
     @Test
@@ -208,9 +208,9 @@ public class TestRestAdapterImpl {
         adapter.commonPut(params, ctx);
 
         assertEquals("failure", ctx.getStatus());
-        assertEquals("500", ctx.getAttribute("org.openecomp.rest.result.code"));
+        assertEquals("500", ctx.getAttribute("org.onap.rest.result.code"));
         assertEquals("org.apache.http.client.ClientProtocolException",
-                     ctx.getAttribute("org.openecomp.rest.result.message"));
+                     ctx.getAttribute("org.onap.rest.result.message"));
     }
 
     @Test
@@ -237,9 +237,9 @@ public class TestRestAdapterImpl {
         adapter.commonDelete(params, ctx);
 
         assertEquals("failure", ctx.getStatus());
-        assertEquals("500", ctx.getAttribute("org.openecomp.rest.result.code"));
+        assertEquals("500", ctx.getAttribute("org.onap.rest.result.code"));
         assertEquals("java.lang.IllegalArgumentException: HTTP request may not be null",
-                     ctx.getAttribute("org.openecomp.rest.result.message"));
+                     ctx.getAttribute("org.onap.rest.result.message"));
     }
 
     @Test
@@ -255,9 +255,9 @@ public class TestRestAdapterImpl {
         adapter.commonDelete(params, ctx);
 
         assertEquals("failure", ctx.getStatus());
-        assertEquals("500", ctx.getAttribute("org.openecomp.rest.result.code"));
+        assertEquals("500", ctx.getAttribute("org.onap.rest.result.code"));
         assertEquals("org.apache.http.client.ClientProtocolException",
-                     ctx.getAttribute("org.openecomp.rest.result.message"));
+                     ctx.getAttribute("org.onap.rest.result.message"));
     }
     
     private HttpRequestBase givenParams(Map<String, String> params, String method){
index 5fab6bb..80904ca 100644 (file)
@@ -58,19 +58,19 @@ public final class Constants {
      * The name for the error message  to be set in the context
      */
     @SuppressWarnings("nls")
-    public static final String CONTEXT_ERROR_MESSAGE = "org.openecomp.rest.result.message";
+    public static final String CONTEXT_ERROR_MESSAGE = "org.onap.rest.result.message";
 
     @SuppressWarnings("nls")
-    public static final String CONTEXT_AGENT_ERROR_MESSAGE = "org.openecomp.rest.agent.result.message";
+    public static final String CONTEXT_AGENT_ERROR_MESSAGE = "org.onap.rest.agent.result.message";
 
     /**
      * The name for the error code  to be set in the context
      */
     @SuppressWarnings("nls")
-    public static final String CONTEXT_ERROR_CODE = "org.openecomp.rest.result.code";
+    public static final String CONTEXT_ERROR_CODE = "org.onap.rest.result.code";
 
     @SuppressWarnings("nls")
-    public static final String CONTEXT_AGENT_ERROR_CODE = "org.openecomp.rest.agent.result.code";
+    public static final String CONTEXT_AGENT_ERROR_CODE = "org.onap.rest.agent.result.code";
 
     /**
      * The name for the success message attribute to be set in the context