SecretDetailResponseV2 { public static Builder builder() { return new AutoValue_SecretDetailResponseV2.Builder() .checksum("") .description("") .type(null) .expiry(0) .metadata(ImmutableMap.of()); } SecretDetailResponseV2(); static Builder builder(); @SuppressWarnings("unused") @JsonCreator static SecretDetailResponseV2 fromParts(
      @JsonProperty("name") String name,
      @JsonProperty("description") @Nullable String description,
      @JsonProperty("checksum") String checksum,
      @JsonProperty("createdAtSeconds") long createdAtSeconds,
      @JsonProperty("createdBy") String createdBy,
      @JsonProperty("updatedAtSeconds") long updatedAtSeconds,
      @JsonProperty("updatedBy") String updatedBy,
      @JsonProperty("metadata") @Nullable Map<String, String> metadata,
      @JsonProperty("type") @Nullable String type,
      @JsonProperty("expiry") long expiry,
      @JsonProperty("version") @Nullable Long version,
      @JsonProperty("contentCreatedAtSeconds") @Nullable Long contentCreatedAtSeconds,
      @JsonProperty("contentCreatedBy") @Nullable String contentCreatedBy); @JsonProperty("name") abstract String name(); @JsonProperty("description") abstract String description(); @JsonProperty("checksum") abstract String checksum(); @JsonProperty("createdAtSeconds") abstract long createdAtSeconds(); @JsonProperty("createdBy") abstract String createdBy(); @JsonProperty("updatedAtSeconds") abstract long updatedAtSeconds(); @JsonProperty("updatedBy") abstract String updatedBy(); @JsonProperty("metadata") abstract ImmutableMap<String, String> metadata(); @JsonProperty("type") @Nullable abstract String type(); @JsonProperty("expiry") abstract long expiry(); @JsonProperty("version") @Nullable abstract Long version(); @JsonProperty("contentCreatedAtSeconds") @Nullable abstract Long contentCreatedAtSeconds(); @JsonProperty("contentCreatedBy") @Nullable abstract String contentCreatedBy(); @Override final String toString();  }
@Test public void formsCorrectlyFromSecretSeriesAndContent() throws Exception { SecretSeries series = SecretSeries.of(1, "secret-name", "secret-description", ApiDate.parse("2013-03-28T21:23:04.159Z"), "creator-user", ApiDate.parse("2014-03-28T21:23:04.159Z"), "updater-user", "text/plain", null, 1L); SecretContent content = SecretContent.of(1, 1, "YXNkZGFz", "checksum", ApiDate.parse("2014-03-28T21:23:04.159Z"), "updater-user", ApiDate.parse("2014-03-28T21:23:04.159Z"), "updater-user", ImmutableMap.of("owner", "root"), 1136214245); SecretSeriesAndContent seriesAndContent = SecretSeriesAndContent.of(series, content); SecretDetailResponseV2 secretDetailResponse = SecretDetailResponseV2.builder() .seriesAndContent(seriesAndContent) .build(); assertThat(asJson(secretDetailResponse)) .isEqualTo(jsonFixture("fixtures/v2/secretDetailResponse.json")); }
@Test public void formsCorrectlyFromSanitizedSecret() throws Exception { SanitizedSecret sanitizedSecret = SanitizedSecret.of(1, "secret-name", "secret-description", "checksum", ApiDate.parse("2013-03-28T21:23:04.159Z"), "creator-user", ApiDate.parse("2014-03-28T21:23:04.159Z"), "updater-user", ImmutableMap.of("owner", "root"), "text/plain", null, 1136214245, 1L, ApiDate.parse("2014-03-28T21:23:04.159Z"), "updater-user"); SecretDetailResponseV2 secretDetailResponse = SecretDetailResponseV2.builder() .sanitizedSecret(sanitizedSecret) .build(); assertThat(asJson(secretDetailResponse)) .isEqualTo(jsonFixture("fixtures/v2/secretDetailResponse.json")); }