Annotation Type Deployment


  • @Retention(RUNTIME)
    public @interface Deployment
    Annotation for a test method to create and delete a deployment around a test method. If no 'resources' or 'extraResources' are set, the current package, test class name and test method are used to find the test resource (see example below).

    Usage:

     package org.example;
     
     ...
     
     public class ExampleTest {
     
       @Deployment
       public void testForADeploymentWithASingleResource() {
         // a deployment will be available in the engine repository
         // containing the single resource org/example/ExampleTest.testForADeploymentWithASingleResource.bpmn20.xml
       }
     
       @Deployment(resources = { 
         "org/example/processOne.bpmn20.xml",
         "org/example/processTwo.bpmn20.xml",
         "org/example/some.other.resource" })
       public void testForADeploymentWithASingleResource() {
         // a deployment will be available in the engine repository
         // containing the three resources
       }
    
       @Deployment(resources = { "org/example/processOne.bpmn20.xml" },
         tenantId = "example")
       public void testForATenantDeploymentWithASingleResource() {
         // a deployment will be available in the engine repository
         // containing the single resource for the specified tenant
       }
     
    Author:
    Dave Syer, Tom Baeyens, Tim Stephenson, Joram Barrez
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String[] extraResources
      Specify resources that are extra, on top of the automatically detected test resources.
      String[] resources
      Specify all the resources that make up the deployment.
      String tenantId
      Specify tenantId to deploy for
    • Element Detail

      • resources

        String[] resources
        Specify all the resources that make up the deployment. When using this property, all resources should be passed, as no automatic detection will be done.
        Default:
        {}
      • extraResources

        String[] extraResources
        Specify resources that are extra, on top of the automatically detected test resources. This is for example useful when testing a BPMN model with a call activity and the called process definition needs to be included too. When using the 'resources' property, both should be passed. With this property, only the called process definition needs to be set.
        Default:
        {}
      • tenantId

        String tenantId
        Specify tenantId to deploy for
        Default:
        ""