Class CmmnAwareTests

  • Direct Known Subclasses:
    ProcessEngineTests

    public class CmmnAwareTests
    extends BpmnAwareTests
    Convenience class to access camunda *BPMN* and *CMMN* related Assertions PLUS helper methods. Use it with a static import: import static org.camunda.bpm.engine.test.assertions.cmmn.CmmnAwareTests.*;
    • Constructor Detail

      • CmmnAwareTests

        public CmmnAwareTests()
    • Method Detail

      • assertThat

        public static CaseInstanceAssert assertThat​(CaseInstance actual)
        Assert that... the given CaseInstance meets your expectations.
        Parameters:
        actual - CaseInstance under test
        Returns:
        Assert object offering CaseInstance specific assertions.
      • assertThat

        public static CaseExecutionAssert assertThat​(CaseExecution actual)
        Assert that... the given CaseExecution meets your expectations.
        Parameters:
        actual - CaseExecution under test
        Returns:
        Assert object offering CaseExecution specific assertions.
      • assertThat

        public static CaseDefinitionAssert assertThat​(CaseDefinition actual)
        Assert that... the given CaseDefinition meets your expectations.
        Parameters:
        actual - ProcessDefinition under test
        Returns:
        Assert object offering ProcessDefinition specific assertions.
      • caseService

        public static CaseService caseService()
        Helper method to easily access CaseService
        Returns:
        CaseService of process engine bound to this testing thread
        See Also:
        CaseService
      • caseInstanceQuery

        public static CaseInstanceQuery caseInstanceQuery()
        Helper method to easily create a new CaseInstanceQuery.
        Returns:
        new CaseInstanceQuery for process engine bound to this testing thread
      • caseExecutionQuery

        public static CaseExecutionQuery caseExecutionQuery()
        Helper method to easily create a new CaseExecutionQuery.
        Returns:
        new CaseExecutionQuery for process engine bound to this testing thread
      • caseDefinitionQuery

        public static CaseDefinitionQuery caseDefinitionQuery()
        Helper method to easily create a new CaseDefinitionQuery.
        Returns:
        new CaseExecutionQuery for process engine bound to this testing thread
      • complete

        public static void complete​(CaseExecution caseExecution)
        Helper method to easily complete a CaseExecution.
        Parameters:
        caseExecution - the CaseExecution to complete
      • disable

        public static void disable​(CaseExecution caseExecution)
        Helper method to easily disable a case execution.
        Parameters:
        caseExecution - the case execution to complete
      • manuallyStart

        public static void manuallyStart​(CaseExecution caseExecution)
        Helper method to manually start a case execution.
        Parameters:
        caseExecution - the case execution to start
      • caseExecution

        public static CaseExecution caseExecution​(java.lang.String activityId,
                                                  CaseInstance caseInstance)
        Helper method to find any CaseExecution in the context of a CaseInstance.
        Parameters:
        activityId - activity to find
        caseInstance - CaseInstance to search in
        Returns:
        CaseExecution or null
      • caseExecution

        public static CaseExecution caseExecution​(CaseExecutionQuery caseExecutionQuery,
                                                  CaseInstance caseInstance)
        Helper method to find any CaseExecution in the context of a CaseInstance
        Parameters:
        caseExecutionQuery - query for narrowing down on the CaseExecution to find
        caseInstance - CaseInstance to search in
        Returns:
        CaseExecution or null
      • complete

        public static void complete​(CaseExecution caseExecution,
                                    java.util.Map<java.lang.String,​java.lang.Object> variables)
        Helper method to easily complete a caseExecution and pass some case variables.
        Parameters:
        caseExecution - CaseExecution to be completed
        variables - Case variables to be passed to the case instance when completing the caseExecution. For setting those variables, you can use BpmnAwareTests.withVariables(String, Object, Object...)