Revert correlationId impl
[so.git] / mso-api-handlers / mso-api-handler-infra / src / test / java / org / openecomp / mso / apihandlerinfra / ServiceInstanceTest.java
index a86a993..50f00ef 100644 (file)
 package org.openecomp.mso.apihandlerinfra;\r
 \r
 \r
-import static org.junit.Assert.assertTrue;\r
-\r
-import java.io.ByteArrayInputStream;\r
-import java.io.InputStream;\r
-import java.util.Collections;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import javax.ws.rs.core.Response;\r
-import mockit.Mock;\r
-import mockit.MockUp;\r
 import org.apache.http.HttpResponse;\r
 import org.apache.http.ProtocolVersion;\r
 import org.apache.http.entity.BasicHttpEntity;\r
@@ -40,23 +30,33 @@ import org.hibernate.criterion.Order;
 import org.junit.BeforeClass;\r
 import org.junit.Ignore;\r
 import org.junit.Test;\r
+\r
+import javax.ws.rs.core.Response;\r
+\r
+import static org.junit.Assert.assertFalse;\r
+import static org.junit.Assert.assertTrue;\r
+import static org.junit.Assert.fail;\r
+\r
+import java.io.ByteArrayInputStream;\r
+import java.io.InputStream;\r
+import java.util.Collections;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+\r
 import org.openecomp.mso.apihandler.common.CamundaClient;\r
 import org.openecomp.mso.apihandler.common.RequestClient;\r
 import org.openecomp.mso.apihandler.common.RequestClientFactory;\r
-import org.openecomp.mso.apihandler.common.RequestClientParamater;\r
 import org.openecomp.mso.db.catalog.CatalogDatabase;\r
-import org.openecomp.mso.db.catalog.beans.Service;\r
-import org.openecomp.mso.db.catalog.beans.ServiceRecipe;\r
-import org.openecomp.mso.db.catalog.beans.VfModule;\r
-import org.openecomp.mso.db.catalog.beans.VfModuleCustomization;\r
-import org.openecomp.mso.db.catalog.beans.VnfComponentsRecipe;\r
-import org.openecomp.mso.db.catalog.beans.VnfRecipe;\r
-import org.openecomp.mso.db.catalog.beans.VnfResource;\r
+import org.openecomp.mso.db.catalog.beans.*;\r
 import org.openecomp.mso.properties.MsoJavaProperties;\r
+import org.openecomp.mso.properties.MsoPropertiesException;\r
 import org.openecomp.mso.properties.MsoPropertiesFactory;\r
 import org.openecomp.mso.requestsdb.InfraActiveRequests;\r
 import org.openecomp.mso.requestsdb.RequestsDatabase;\r
 \r
+import mockit.Mock;\r
+import mockit.MockUp;\r
+\r
 public class ServiceInstanceTest {\r
 \r
        /*** Create Service Instance Test Cases ***/\r
@@ -225,11 +225,15 @@ public class ServiceInstanceTest {
         \r
         new MockUp<CamundaClient>() {\r
             @Mock\r
-            public HttpResponse post(RequestClientParamater requestClientParamater) {\r
+            public HttpResponse post(String requestId, boolean isBaseVfModule,\r
+                               int recipeTimeout, String requestAction, String serviceInstanceId,\r
+                               String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,\r
+                               String serviceType, String vnfType, String vfModuleType, String networkType,\r
+                               String requestDetails, String recipeParamXsd){ \r
                ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);\r
                HttpResponse resp = new BasicHttpResponse(pv,200, "test response");\r
                BasicHttpEntity entity = new BasicHttpEntity();\r
-               String body = "{\"response\":\"success\",\"message\":\"success\"}";\r
+               String body = "{\"content\":\"success\",\"message\":\"success\"}";\r
                InputStream instream = new ByteArrayInputStream(body.getBytes());\r
                entity.setContent(instream);\r
                resp.setEntity(entity);\r
@@ -291,11 +295,15 @@ public class ServiceInstanceTest {
         \r
         new MockUp<CamundaClient>() {\r
             @Mock\r
-            public HttpResponse post(RequestClientParamater requestClientParamater) {\r
+            public HttpResponse post(String requestId, boolean isBaseVfModule,\r
+                               int recipeTimeout, String requestAction, String serviceInstanceId,\r
+                               String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,\r
+                               String serviceType, String vnfType, String vfModuleType, String networkType,\r
+                               String requestDetails, String recipeParamXsd){ \r
                ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);\r
                HttpResponse resp = new BasicHttpResponse(pv,500, "test response");\r
                BasicHttpEntity entity = new BasicHttpEntity();\r
-               String body = "{\"response\":\"success\",\"message\":\"success\"}";\r
+               String body = "{\"content\":\"success\",\"message\":\"success\"}";\r
                InputStream instream = new ByteArrayInputStream(body.getBytes());\r
                entity.setContent(instream);\r
                resp.setEntity(entity);\r
@@ -358,11 +366,15 @@ public class ServiceInstanceTest {
         \r
         new MockUp<CamundaClient>() {\r
             @Mock\r
-            public HttpResponse post(RequestClientParamater requestClientParamater) {\r
+            public HttpResponse post(String requestId, boolean isBaseVfModule,\r
+                               int recipeTimeout, String requestAction, String serviceInstanceId,\r
+                               String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,\r
+                               String serviceType, String vnfType, String vfModuleType, String networkType,\r
+                               String requestDetails, String recipeParamXsd){ \r
                ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);\r
                HttpResponse resp = new BasicHttpResponse(pv,500, "test response");\r
                BasicHttpEntity entity = new BasicHttpEntity();\r
-               String body = "{\"response\":\"success\",\"message\":\"success\"}";\r
+               String body = "{\"content\":\"success\",\"message\":\"success\"}";\r
                InputStream instream = new ByteArrayInputStream(body.getBytes());\r
                entity.setContent(instream);\r
                resp.setEntity(entity);\r
@@ -425,7 +437,11 @@ public class ServiceInstanceTest {
         \r
         new MockUp<CamundaClient>() {\r
             @Mock\r
-            public HttpResponse post(RequestClientParamater requestClientParamater){\r
+            public HttpResponse post(String requestId, boolean isBaseVfModule,\r
+                               int recipeTimeout, String requestAction, String serviceInstanceId,\r
+                               String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,\r
+                               String serviceType, String vnfType, String vfModuleType, String networkType,\r
+                               String requestDetails, String recipeParamXsd){ \r
                return null;\r
             }\r
         };\r
@@ -907,12 +923,16 @@ public class ServiceInstanceTest {
 \r
                new MockUp<CamundaClient>() {\r
                        @Mock\r
-                       public HttpResponse post(RequestClientParamater requestClientParamater) {\r
+                       public HttpResponse post(String requestId, boolean isBaseVfModule,\r
+                                                                        int recipeTimeout, String requestAction, String serviceInstanceId,\r
+                                                                        String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,\r
+                                                                        String serviceType, String vnfType, String vfModuleType, String networkType,\r
+                                                                        String requestDetails, String recipeParamXsd){\r
                                ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);\r
                                HttpResponse resp = new BasicHttpResponse(pv,200, "test response");\r
                                BasicHttpEntity entity = new BasicHttpEntity();\r
 \r
-                               final String body = "{\"response\":\"success\",\"message\":\"success\"}";\r
+                               final String body = "{\"content\":\"success\",\"message\":\"success\"}";\r
                                InputStream instream = new ByteArrayInputStream(body.getBytes());\r
                                entity.setContent(instream);\r
                                resp.setEntity(entity);\r
@@ -1072,12 +1092,16 @@ public class ServiceInstanceTest {
 \r
                new MockUp<CamundaClient>() {\r
                        @Mock\r
-                       public HttpResponse post(RequestClientParamater requestClientParamater){\r
+                       public HttpResponse post(String requestId, boolean isBaseVfModule,\r
+                                                                        int recipeTimeout, String requestAction, String serviceInstanceId,\r
+                                                                        String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,\r
+                                                                        String serviceType, String vnfType, String vfModuleType, String networkType,\r
+                                                                        String requestDetails, String recipeParamXsd){\r
                                ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);\r
                                HttpResponse resp = new BasicHttpResponse(pv,200, "test response");\r
                                BasicHttpEntity entity = new BasicHttpEntity();\r
 \r
-                               final String body = "{\"response\":\"success\",\"message\":\"success\"}";\r
+                               final String body = "{\"content\":\"success\",\"message\":\"success\"}";\r
                                InputStream instream = new ByteArrayInputStream(body.getBytes());\r
                                entity.setContent(instream);\r
                                resp.setEntity(entity);\r
@@ -1119,12 +1143,16 @@ public class ServiceInstanceTest {
 \r
                new MockUp<CamundaClient>() {\r
                        @Mock\r
-                       public HttpResponse post(RequestClientParamater requestClientParamater) {\r
+                       public HttpResponse post(String requestId, boolean isBaseVfModule,\r
+                                                                        int recipeTimeout, String requestAction, String serviceInstanceId,\r
+                                                                        String vnfId, String vfModuleId, String volumeGroupId, String networkId, String configurationId,\r
+                                                                        String serviceType, String vnfType, String vfModuleType, String networkType,\r
+                                                                        String requestDetails, String recipeParamXsd){\r
                                ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);\r
                                HttpResponse resp = new BasicHttpResponse(pv,200, "test response");\r
                                BasicHttpEntity entity = new BasicHttpEntity();\r
 \r
-                               final String body = "{\"response\":\"success\",\"message\":\"success\"}";\r
+                               final String body = "{\"content\":\"success\",\"message\":\"success\"}";\r
                                InputStream instream = new ByteArrayInputStream(body.getBytes());\r
                                entity.setContent(instream);\r
                                resp.setEntity(entity);\r