* ============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
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
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() {
}
- // ***** 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"))
assertTrue(checkMissingPreProcessRequest("vgmuxBearerIP"))
assertTrue(checkMissingPreProcessRequest("brgWanMacAddress"))
assertTrue(checkMissingPreProcessRequest("allottedResourceRole"))
- assertTrue(checkMissingPreProcessRequest("allottedResourceType"))\r
+ assertTrue(checkMissingPreProcessRequest("allottedResourceType"))
}
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)
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)
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")
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
+ }
+
}