Merge "Reorder modifiers"
[so.git] / bpmn / MSOInfrastructureBPMN / src / test / groovy / org / openecomp / mso / bpmn / vcpe / scripts / DoCreateAllottedResourceBRGTest.groovy
index ecf3869..c8afb22 100644 (file)
  * ============LICENSE_END=========================================================
  */
 package org.openecomp.mso.bpmn.vcpe.scripts
-\r
-\r
-import org.camunda.bpm.engine.ProcessEngineServices\r
-import org.camunda.bpm.engine.RepositoryService\r
-import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity\r
-import org.camunda.bpm.engine.repository.ProcessDefinition\r
-import org.camunda.bpm.engine.runtime.Execution\r
+
+
+import org.camunda.bpm.engine.ProcessEngineServices
+import org.camunda.bpm.engine.RepositoryService
+import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
+import org.camunda.bpm.engine.repository.ProcessDefinition
 import org.junit.Before
-import org.junit.BeforeClass\r
-import org.junit.Rule\r
+import org.junit.BeforeClass
+import org.junit.Rule
 import org.junit.Test
-import org.junit.Ignore\r
+import org.junit.Ignore
 import org.mockito.MockitoAnnotations
-import org.camunda.bpm.engine.delegate.BpmnError\r
+import org.camunda.bpm.engine.delegate.BpmnError
 import org.openecomp.mso.bpmn.core.WorkflowException
 import org.openecomp.mso.bpmn.mock.FileUtil
 
@@ -39,7 +38,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.aResponse
 import static com.github.tomakehurst.wiremock.client.WireMock.put
 import static com.github.tomakehurst.wiremock.client.WireMock.stubFor
 import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching
-import static org.junit.Assert.*;\r
+import static org.junit.Assert.*;
 import static org.mockito.Mockito.*
 import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource
 import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPatchAllottedResource
@@ -49,24 +48,24 @@ import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutAllottedResourc
 import org.openecomp.mso.bpmn.core.RollbackData
 import org.openecomp.mso.bpmn.vcpe.scripts.MapSetter
 
-import com.github.tomakehurst.wiremock.junit.WireMockRule\r
-\r
+import com.github.tomakehurst.wiremock.junit.WireMockRule
+
 class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
-       \r
-       @Rule\r
+       
+       @Rule
        public WireMockRule wireMockRule = new WireMockRule(PORT)
-\r
-       String Prefix = "DCARBRG_"\r
+
+       String Prefix = "DCARBRG_"
 
        @BeforeClass
        public static void setUpBeforeClass() {
-               super.setUpBeforeClass()
+               // nothing for now
        }
-         \r
-    @Before\r
-       public void init()\r
-       {\r
-               MockitoAnnotations.initMocks(this)\r
+         
+    @Before
+       public void init()
+       {
+               MockitoAnnotations.initMocks(this)
        }
        
        public DoCreateAllottedResourceBRGTest() {
@@ -74,19 +73,19 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
        }
        
        
-       // ***** preProcessRequest *****\r
-                       \r
-       @Test\r
-//     @Ignore  \r
-       public void preProcessRequest() {\r
+       // ***** preProcessRequest *****
+                       
+       @Test
+//     @Ignore  
+       public void preProcessRequest() {
                ExecutionEntity mex = setupMock()
                initPreProcess(mex)
-               \r
-               DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()\r
-               DoCreateAllottedResourceBRG.preProcessRequest(mex)\r
-\r
-               verify(mex).getVariable(DBGFLAG)\r
-               verify(mex).setVariable("prefix", Prefix)\r
+               
+               DoCreateAllottedResourceBRG DoCreateAllottedResourceBRG = new DoCreateAllottedResourceBRG()
+               DoCreateAllottedResourceBRG.preProcessRequest(mex)
+
+               verify(mex).getVariable(DBGFLAG)
+               verify(mex).setVariable("prefix", Prefix)
                                
                assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdncadapter_callback"))
                assertTrue(checkMissingPreProcessRequest("URN_mso_workflow_sdnc_replication_delay"))
@@ -97,7 +96,7 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
                assertTrue(checkMissingPreProcessRequest("vgmuxBearerIP"))
                assertTrue(checkMissingPreProcessRequest("brgWanMacAddress"))
                assertTrue(checkMissingPreProcessRequest("allottedResourceRole"))
-               assertTrue(checkMissingPreProcessRequest("allottedResourceType"))\r
+               assertTrue(checkMissingPreProcessRequest("allottedResourceType"))
        }
        
        
@@ -297,8 +296,10 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
                assertTrue(result.indexOf("<sdncadapter:SvcAction>myact</") >= 0)
                assertTrue(result.indexOf("<allotted-resource-id>ari</") >= 0)
                assertTrue(result.indexOf("<sdncadapter:SvcInstanceId>sii</") >= 0)
-               assertTrue(result.indexOf("<service-instance-id>psii</") >= 0)
+               assertTrue(result.indexOf("<service-instance-id>sii</") >= 0)
                assertTrue(result.indexOf("<parent-service-instance-id>psii</") >= 0)
+               assertTrue(result.indexOf("<subscription-service-type>sst</") >= 0)
+               assertTrue(result.indexOf("<global-customer-id>gci</") >= 0)
                assertTrue(result.indexOf("<sdncadapter:CallbackUrl>scu</") >= 0)
                assertTrue(result.indexOf("<request-id>mri</") >= 0)
                assertTrue(result.indexOf("<brg-wan-mac-address>bwma</") >= 0)
@@ -327,8 +328,10 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
                assertTrue(result.indexOf("<sdncadapter:SvcAction>myact</") >= 0)
                assertTrue(result.indexOf("<allotted-resource-id>ari</") >= 0)
                assertTrue(result.indexOf("<sdncadapter:SvcInstanceId>sii</") >= 0)
-               assertTrue(result.indexOf("<service-instance-id>psii</") >= 0)
+               assertTrue(result.indexOf("<service-instance-id>sii</") >= 0)
                assertTrue(result.indexOf("<parent-service-instance-id>psii</") >= 0)
+               assertTrue(result.indexOf("<subscription-service-type>sst</") >= 0)
+               assertTrue(result.indexOf("<global-customer-id>gci</") >= 0)
                assertTrue(result.indexOf("<sdncadapter:CallbackUrl>scu</") >= 0)
                assertTrue(result.indexOf("<request-id>mri</") >= 0)
                assertTrue(result.indexOf("<brg-wan-mac-address>bwma</") >= 0)
@@ -933,6 +936,8 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
                when(mex.getVariable("allottedResourceId")).thenReturn("ari")
                when(mex.getVariable("serviceInstanceId")).thenReturn("sii")
                when(mex.getVariable("parentServiceInstanceId")).thenReturn("psii")
+               when(mex.getVariable("subscriptionServiceType")).thenReturn("sst")
+               when(mex.getVariable("globalCustomerId")).thenReturn("gci")
                when(mex.getVariable("sdncCallbackUrl")).thenReturn("scu")
                when(mex.getVariable("msoRequestId")).thenReturn("mri")
                when(mex.getVariable("brgWanMacAddress")).thenReturn("bwma")
@@ -986,6 +991,6 @@ class DoCreateAllottedResourceBRGTest extends GroovyTestBase {
        private initUpdateAaiAROrchStatus(ExecutionEntity mex) {
                when(mex.getVariable(DBGFLAG)).thenReturn("true")
                when(mex.getVariable("aaiARPath")).thenReturn(aaiUriPfx + "/aai/v9/business/customers/customer/"+CUST+"/service-subscriptions/service-subscription/"+SVC+"/service-instances/service-instance/"+INST+"/allotted-resources/allotted-resource/"+ARID)
-       }\r
-               \r
+       }
+               
 }