@Test
public void convertAndValidateWorks() {

  CreateWorkflowInstanceRequest req = new CreateWorkflowInstanceRequest();
  req.activationTime = DateTime.now();
  req.businessKey = "businessKey";
  req.externalId = "externalId";
  req.type = "wfType";
  req.startState = "startState";
  req.stateVariables.put("foo", "bar");
  req.stateVariables.put("textNode", new TextNode("text"));
  WorkflowInstance i = converter.convert(req);
  assertThat(i.nextActivation, equalTo(req.activationTime));
  assertThat(i.businessKey, equalTo(req.businessKey));
  assertThat(i.externalId, equalTo(req.externalId));
  assertThat(i.type, equalTo(req.type));
  assertThat(i.state, equalTo("startState"));
  assertThat(i.stateVariables.get("foo"), is("bar"));
  assertThat(i.stateVariables.get("textNode"), is("\"text\""));
}