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
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
\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
\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
\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
\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
\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
\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
\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