Skip to content

Assert variables list has specific variables and class types #14

@StephenOTT

Description

@StephenOTT
import static org.hamcrest.CoreMatchers.is;
// import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItems;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.both;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasProperty;

      def processInstanceId = processInstance.getProcessInstanceId()
      def historicVariableInstanceQuery = historyService().createHistoricVariableInstanceQuery().processInstanceId(processInstanceId)

      assertThat(historicVariableInstanceQuery.list(), hasItems(
                                                                both(hasProperty("name", equalTo("myJSON"))).and(instanceOf(org.camunda.bpm.engine.impl.persistence.entity.HistoricVariableInstanceEntity.class)),
                                                                both(hasProperty("name", equalTo("mySpinVar"))).and(instanceOf(org.camunda.bpm.engine.impl.persistence.entity.HistoricVariableInstanceEntity.class)),
                                                                ));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions