@Test
public void shouldDeserializeExecution() throws Exception {

  String json =
      executionJson("exec-id", "busybox:1.0", "commit-sha", TEST_RUNNER_ID, "09", "SUCCESS", Optional.empty());
  Execution execution = OBJECT_MAPPER.readValue(json, Execution.class);
  Execution expected = Execution.create(
      Optional.of("exec-id"),
      Optional.of("busybox:1.0"),
      Optional.of("commit-sha"),
      Optional.of(TEST_RUNNER_ID),
      Arrays.asList(
          ExecStatus.create(Instant.parse("2016-08-03T09:56:03.607Z"), "STARTED", Optional.empty()),
          ExecStatus.create(Instant.parse("2016-08-03T09:57:03.607Z"), "RUNNING", Optional.empty()),
          ExecStatus.create(Instant.parse("2016-08-03T09:58:03.607Z"), "SUCCESS", Optional.empty())
      )
  );
  assertThat(execution, is(expected));
}