@Test
public void convertWithEmptyStateVariablesWorks() {

  WorkflowInstanceAction a = new WorkflowInstanceAction.Builder().setId(929).setType(stateExecution).setState("oState")
      .setStateText("oState desc").setRetryNo(1).setExecutionStart(now().minusDays(1)).setExecutionEnd(now().plusDays(1))
      .build();
  WorkflowInstance i = new WorkflowInstance.Builder().setId(1).setStatus(inProgress).setType("dummy")
      .setBusinessKey("businessKey").setExternalId("externalId").setState("cState").setStateText("cState desc")
      .setNextActivation(now()).setActions(Arrays.asList(a)).setStateVariables(new LinkedHashMap<String, String>()).build();
  ListWorkflowInstanceResponse resp = converter.convert(i, EnumSet.of(WorkflowInstanceInclude.CURRENT_STATE_VARIABLES));
  assertThat(resp.id, is(i.id));
  assertThat(resp.status, is(i.status.name()));
  assertThat(resp.stateVariables, is((Map<String, Object>) null));
  assertThat(resp.type, is(i.type));
  assertThat(resp.businessKey, is(i.businessKey));
  assertThat(resp.externalId, is(i.externalId));
  assertThat(resp.state, is(i.state));
  assertThat(resp.stateText, is(i.stateText));
  assertThat(resp.nextActivation, is(i.nextActivation));
  assertThat(resp.actions, nullValue());
}