InternalSchemaMetadataPayloadCodec { static VersionedInternalSchemaMetadata encode(InternalSchemaMetadata internalSchemaMetadata) { try { return ImmutableVersionedInternalSchemaMetadata.builder() .version(LATEST_VERSION) .payload(OBJECT_MAPPER.writeValueAsBytes(internalSchemaMetadata)) .build(); } catch (JsonProcessingException e) { throw new RuntimeException(e); } } private  InternalSchemaMetadataPayloadCodec();  static final int LATEST_VERSION; }
@Test public void serializesToTheLatestVersion() { VersionedInternalSchemaMetadata encoded = InternalSchemaMetadataPayloadCodec.encode(INTERNAL_SCHEMA_METADATA); assertThat(encoded.version()).isEqualTo(InternalSchemaMetadataPayloadCodec.LATEST_VERSION); }