@Test
public void convertStoredDefinitionWorks() {

  StoredWorkflowDefinition stored = new StoredWorkflowDefinition();
  stored.description = "desc";
  stored.onError = "errorState";
  stored.type = "storedDefinition";
  StoredWorkflowDefinition.State storedState = new StoredWorkflowDefinition.State("first", "normal", "first state desc");
  stored.states = asList(storedState);
  StoredWorkflowDefinition.Signal storedSignal = new StoredWorkflowDefinition.Signal();
  storedSignal.value = 1;
  storedSignal.description = "one";
  stored.supportedSignals = asList(storedSignal);
  ListWorkflowDefinitionResponse resp = converter.convert(stored);
  assertThat(resp.description, is(stored.description));
  assertThat(resp.onError, is(stored.onError));
  assertThat(resp.states.length, is(1));
  assertThat(resp.states[0].description, is(storedState.description));
  assertThat(resp.states[0].type, is(storedState.type));
  assertThat(resp.states[0].id, is(storedState.id));
  assertThat(resp.supportedSignals[0].value, is(storedSignal.value));
  assertThat(resp.supportedSignals[0].description, is(storedSignal.description));
}