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)),
));