@Test
public void workflowInstanceBuilder() {

  WorkflowInstance.Builder builder = executionInterface.workflowInstanceBuilder();
  Object data = new Data(32, "foobar");
  String serializedData = "data in serialized form";
  when(objectStringMapper.convertFromObject("foo", data)).thenReturn(serializedData);
  assertThat(builder, is(notNullValue()));
  builder.putStateVariable("foo", data);
  WorkflowInstance i = builder.build();
  assertThat(i.nextActivation, is(notNullValue()));
  assertThat(i.stateVariables, hasEntry("foo", serializedData));
  verify(objectStringMapper).convertFromObject("foo", data);
}