@Test public void cannotDeserializeUnknownVersionOfMetadata() { assertThatThrownBy(() -> InternalSchemaMetadataPayloadCodec.decode(ImmutableVersionedInternalSchemaMetadata.builder() .version(8377466) .payload(new byte[] {1, 2, 3}) .build())) .isInstanceOf(IllegalStateException.class) .hasMessageContaining("Could not decode persisted internal schema metadata - unrecognized version."); }
static InternalSchemaMetadata decode(VersionedInternalSchemaMetadata versionedInternalSchemaMetadata) { return tryDecode(versionedInternalSchemaMetadata) .orElseThrow(() -> new SafeIllegalStateException("Could not decode persisted internal schema metadata -" + " unrecognized version. This may occur transiently during upgrades, but if it persists please" + " contact support.", SafeArg.of("internalSchemaMetadata", versionedInternalSchemaMetadata), SafeArg.of("knownVersions", SUPPORTED_DECODERS.keySet()))); }
InternalSchemaMetadataPayloadCodec { static InternalSchemaMetadata decode(VersionedInternalSchemaMetadata versionedInternalSchemaMetadata) { return tryDecode(versionedInternalSchemaMetadata) .orElseThrow(() -> new SafeIllegalStateException("Could not decode persisted internal schema metadata -" + " unrecognized version. This may occur transiently during upgrades, but if it persists please" + " contact support.", SafeArg.of("internalSchemaMetadata", versionedInternalSchemaMetadata), SafeArg.of("knownVersions", SUPPORTED_DECODERS.keySet()))); } }
InternalSchemaMetadataPayloadCodec { static InternalSchemaMetadata decode(VersionedInternalSchemaMetadata versionedInternalSchemaMetadata) { return tryDecode(versionedInternalSchemaMetadata) .orElseThrow(() -> new SafeIllegalStateException("Could not decode persisted internal schema metadata -" + " unrecognized version. This may occur transiently during upgrades, but if it persists please" + " contact support.", SafeArg.of("internalSchemaMetadata", versionedInternalSchemaMetadata), SafeArg.of("knownVersions", SUPPORTED_DECODERS.keySet()))); } private  InternalSchemaMetadataPayloadCodec(); }
InternalSchemaMetadataPayloadCodec { static InternalSchemaMetadata decode(VersionedInternalSchemaMetadata versionedInternalSchemaMetadata) { return tryDecode(versionedInternalSchemaMetadata) .orElseThrow(() -> new SafeIllegalStateException("Could not decode persisted internal schema metadata -" + " unrecognized version. This may occur transiently during upgrades, but if it persists please" + " contact support.", SafeArg.of("internalSchemaMetadata", versionedInternalSchemaMetadata), SafeArg.of("knownVersions", SUPPORTED_DECODERS.keySet()))); } private  InternalSchemaMetadataPayloadCodec();  }
InternalSchemaMetadataPayloadCodec { static InternalSchemaMetadata decode(VersionedInternalSchemaMetadata versionedInternalSchemaMetadata) { return tryDecode(versionedInternalSchemaMetadata) .orElseThrow(() -> new SafeIllegalStateException("Could not decode persisted internal schema metadata -" + " unrecognized version. This may occur transiently during upgrades, but if it persists please" + " contact support.", SafeArg.of("internalSchemaMetadata", versionedInternalSchemaMetadata), SafeArg.of("knownVersions", SUPPORTED_DECODERS.keySet()))); } private  InternalSchemaMetadataPayloadCodec();  static final int LATEST_VERSION; }