When running unit tests you deploy through the API with something like:
@Deployment(resources = ["bpmn/ExternalScriptTest/myProcess.bpmn", "bpmn/ExternalScriptTest/file.js" ])
But the BPMN file has a “deployment://file.js” as the resource path, which functions when using Rest API deployment. If you change this to: deployment://bpmn/ExternalScriptTest/file.js
the test passes.
<bpmn:scriptTask id="ScriptTask_1ujmwh7" name="My Script" scriptFormat="javascript" camunda:resource="deployment://file.js">
How do you reconcile this difference in unit testing?
As i understand it, when you @Deployment(resources = ["bpmn/ExternalScriptTest/myProcess.bpmn", "bpmn/ExternalScriptTest/file.js" ])
, are you deploying the file to the classpath rather than into the database?
Currently you get the following error:
org.camunda.bpm.engine.exception.NotFoundException: ENGINE-09024 Unable to find resource at path deployment://file.js
I looked through the Unit Tests and the closest i could find was the following:
- https://github.com/camunda/camunda-bpm-platform/blob/master/engine/src/test/java/org/camunda/bpm/engine/test/bpmn/scripttask/ExternalScriptTaskTest.java
- https://github.com/camunda/camunda-bpm-platform/blob/master/engine/src/test/resources/org/camunda/bpm/engine/test/bpmn/scripttask/ExternalScriptTaskTest.testDefaultExternalScriptAsVariable.bpmn20.xml
- https://github.com/camunda/camunda-bpm-platform/blob/master/engine/src/test/resources/org/camunda/bpm/engine/test/bpmn/scripttask/ExternalScriptTaskTest.testScriptInDeployment.bpmn20.xml
- https://github.com/camunda/camunda-bpm-platform/blob/master/engine/src/test/resources/org/camunda/bpm/engine/test/bpmn/iomapping/InputOutputTest.testInputExternalDeploymentScriptValue.bpmn
- https://github.com/camunda/camunda-bpm-platform/blob/master/engine/src/test/resources/org/camunda/bpm/engine/test/bpmn/iomapping/InputOutputTest.testOutputExternalDeploymentScriptValue.bpmn
In each of the Unit tests that used deployment://
they all follow the folder structure rather than the style that is used in Rest API deployments.
Thanks!