Merge "Add correlationId to ServiceInstancesRequest"
[so.git] / mso-api-handlers / mso-api-handler-infra / src / test / java / org / openecomp / mso / apihandlerinfra / ServiceInstanceTest.java
index 50f00ef..938a103 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
@@ -30,33 +40,23 @@ 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.*;\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.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,7 @@ public class ServiceInstanceTest {
         \r
         new MockUp<CamundaClient>() {\r
             @Mock\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
+            public HttpResponse post(RequestClientParamater requestClientParamater) {\r
                ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);\r
                HttpResponse resp = new BasicHttpResponse(pv,200, "test response");\r
                BasicHttpEntity entity = new BasicHttpEntity();\r
@@ -295,11 +291,7 @@ public class ServiceInstanceTest {
         \r
         new MockUp<CamundaClient>() {\r
             @Mock\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
+            public HttpResponse post(RequestClientParamater requestClientParamater) {\r
                ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);\r
                HttpResponse resp = new BasicHttpResponse(pv,500, "test response");\r
                BasicHttpEntity entity = new BasicHttpEntity();\r
@@ -366,11 +358,7 @@ public class ServiceInstanceTest {
         \r
         new MockUp<CamundaClient>() {\r
             @Mock\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
+            public HttpResponse post(RequestClientParamater requestClientParamater) {\r
                ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);\r
                HttpResponse resp = new BasicHttpResponse(pv,500, "test response");\r
                BasicHttpEntity entity = new BasicHttpEntity();\r
@@ -437,11 +425,7 @@ public class ServiceInstanceTest {
         \r
         new MockUp<CamundaClient>() {\r
             @Mock\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
+            public HttpResponse post(RequestClientParamater requestClientParamater){\r
                return null;\r
             }\r
         };\r
@@ -923,11 +907,7 @@ public class ServiceInstanceTest {
 \r
                new MockUp<CamundaClient>() {\r
                        @Mock\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
+                       public HttpResponse post(RequestClientParamater requestClientParamater) {\r
                                ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);\r
                                HttpResponse resp = new BasicHttpResponse(pv,200, "test response");\r
                                BasicHttpEntity entity = new BasicHttpEntity();\r
@@ -1092,11 +1072,7 @@ public class ServiceInstanceTest {
 \r
                new MockUp<CamundaClient>() {\r
                        @Mock\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
+                       public HttpResponse post(RequestClientParamater requestClientParamater){\r
                                ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);\r
                                HttpResponse resp = new BasicHttpResponse(pv,200, "test response");\r
                                BasicHttpEntity entity = new BasicHttpEntity();\r
@@ -1143,11 +1119,7 @@ public class ServiceInstanceTest {
 \r
                new MockUp<CamundaClient>() {\r
                        @Mock\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
+                       public HttpResponse post(RequestClientParamater requestClientParamater) {\r
                                ProtocolVersion pv = new ProtocolVersion("HTTP",1,1);\r
                                HttpResponse resp = new BasicHttpResponse(pv,200, "test response");\r
                                BasicHttpEntity entity = new BasicHttpEntity();\r