public static PortabilityJob.Builder builder() {
    Instant now = Instant.now();
    // TODO: Fix so we don't need fully qualified name here. This is to get IntelliJ to recognize
    // the class name due to a conflict in package names for our generated code, but the conflict
    // doesn't cause any actual problems with building.
    return new org.datatransferproject.spi.cloud.types.AutoValue_PortabilityJob.Builder()
        .setState(State.NEW)
        .setCreatedTimestamp(now)
        .setLastUpdateTimestamp(now)
        .setFailureReason(null);
  }
@Test
  public void verifySerializeDeserializeWithAlbum() throws IOException {
    ObjectMapper objectMapper = ObjectMapperFactory.createObjectMapper();
    Instant date = Instant.now();

    JobAuthorization jobAuthorization =
        JobAuthorization.builder()
            .setState(JobAuthorization.State.INITIAL)
            .setSessionSecretKey("foo")
            .build();

    PortabilityJob job =
        PortabilityJob.builder()
            .setState(State.NEW)
            .setExportService("fooService")
            .setImportService("barService")
            .setTransferDataType(PHOTOS)
            .setExportInformation(
                objectMapper.writeValueAsString(
                    new ExportInformation(
                        null,
                        new PhotosContainerResource(
                            Lists.newArrayList(
                                new PhotoAlbum("album_id", "album name", "album description")),
                            null))))
            .setCreatedTimestamp(date)
            .setLastUpdateTimestamp(date.plusSeconds(120))
            .setJobAuthorization(jobAuthorization)
            .build();

    String serializedJobAuthorization = objectMapper.writeValueAsString(jobAuthorization);
    JobAuthorization deserializedJobAuthorization =
        objectMapper.readValue(serializedJobAuthorization, JobAuthorization.class);
    assertThat(deserializedJobAuthorization).isEqualTo(jobAuthorization);

    String serializedJob = objectMapper.writeValueAsString(job);
    PortabilityJob deserializedJob = objectMapper.readValue(serializedJob, PortabilityJob.class);
    assertThat(deserializedJob).isEqualTo(job);
  }