diff options
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy')
-rw-r--r-- | bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy | 71 |
1 files changed, 35 insertions, 36 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy index 65c9e456e4..af56f34bce 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustServiceTest.groovy @@ -18,20 +18,20 @@ * ============LICENSE_END========================================================= */ package org.openecomp.mso.bpmn.vcpe.scripts -
-
-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.camunda.bpm.engine.runtime.Execution
+ + +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.camunda.bpm.engine.runtime.Execution import org.junit.Before -import org.junit.BeforeClass
-import org.junit.Rule
+import org.junit.BeforeClass +import org.junit.Rule import org.junit.Test -import org.junit.Ignore
+import org.junit.Ignore import org.mockito.MockitoAnnotations -import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.delegate.BpmnError import org.openecomp.mso.bpmn.core.WorkflowException import org.openecomp.mso.bpmn.mock.FileUtil @@ -41,7 +41,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.patch 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.*;
+import static org.junit.Assert.*; import static org.mockito.Mockito.* import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockGetAllottedResource import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition @@ -53,28 +53,27 @@ import org.openecomp.mso.bpmn.core.RollbackData import org.openecomp.mso.bpmn.vcpe.scripts.MapGetter import org.openecomp.mso.bpmn.vcpe.scripts.MapSetter -import com.github.tomakehurst.wiremock.junit.WireMockRule
-
+import com.github.tomakehurst.wiremock.junit.WireMockRule + class DeleteVcpeResCustServiceTest extends GroovyTestBase { - private static String request
-
- @Rule
+ private static String request + + @Rule public WireMockRule wireMockRule = new WireMockRule(PORT) -
+ String Prefix = "DVRCS_" - String RbType = "DCRENI_"
+ String RbType = "DCRENI_" @BeforeClass public static void setUpBeforeClass() { - super.setUpBeforeClass() request = FileUtil.readResourceFile("__files/VCPE/DeleteVcpeResCustService/request.json") } -
- @Before
- public void init()
- {
- MockitoAnnotations.initMocks(this)
+ + @Before + public void init() + { + MockitoAnnotations.initMocks(this) } public DeleteVcpeResCustServiceTest() { @@ -82,18 +81,18 @@ class DeleteVcpeResCustServiceTest extends GroovyTestBase { } - // ***** preProcessRequest *****
-
- @Test
-// @Ignore
- public void preProcessRequest() {
+ // ***** preProcessRequest ***** + + @Test +// @Ignore + public void preProcessRequest() { ExecutionEntity mex = setupMock() def map = setupMap(mex) initPreProcess(mex) -
- DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService()
- DeleteVcpeResCustService.preProcessRequest(mex)
-
+ + DeleteVcpeResCustService DeleteVcpeResCustService = new DeleteVcpeResCustService() + DeleteVcpeResCustService.preProcessRequest(mex) + verify(mex).getVariable(DBGFLAG) assertEquals(Prefix, map.get("prefix")) @@ -116,7 +115,7 @@ class DeleteVcpeResCustServiceTest extends GroovyTestBase { def reqinfo = map.get(Prefix+"requestInfo") assertTrue(reqinfo.indexOf("<request-id>mri</") >= 0) - assertTrue(reqinfo.indexOf("<source>VID</") >= 0)
+ assertTrue(reqinfo.indexOf("<source>VID</") >= 0) } @Test @@ -771,5 +770,5 @@ class DeleteVcpeResCustServiceTest extends GroovyTestBase { .withStatus(status) .withHeader("Content-Type", "text/xml") .withBodyFile("VCPE/DeleteVcpeResCustService/" + fileResp))); - }
+ } } |