Light, fluffy, and always free - The AWS Local Emulator alternative
fix: register persisted model types for native-image reflection (#1781)
Hector Venturade13017cd37e
diff --git a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/Account.java b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/Account.javaindex 811733c94f..3ac75ab26e 100644--- a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/Account.java+++ b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/Account.java@@ -1,11 +1,14 @@package io.github.hectorvent.floci.services.apigateway.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.util.ArrayList;import java.util.List;import com.fasterxml.jackson.annotation.JsonIgnoreProperties;@JsonIgnoreProperties(ignoreUnknown = true)+@RegisterForReflectionpublic class Account {private String apiKeyVersion = "4";diff --git a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/ApiGatewayResource.java b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/ApiGatewayResource.javaindex 3e5cf0e01b..25fe58e0c2 100644--- a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/ApiGatewayResource.java+++ b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/ApiGatewayResource.java@@ -1,11 +1,14 @@package io.github.hectorvent.floci.services.apigateway.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;import java.util.HashMap;import java.util.Map;@JsonIgnoreProperties(ignoreUnknown = true)+@RegisterForReflectionpublic class ApiGatewayResource {private String id;diff --git a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/Deployment.java b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/Deployment.javaindex ce6b3fe81e..030d31be99 100644--- a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/Deployment.java+++ b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/Deployment.java@@ -1,8 +1,11 @@package io.github.hectorvent.floci.services.apigateway.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;@JsonIgnoreProperties(ignoreUnknown = true)+@RegisterForReflectionpublic record Deployment(String id,String description,diff --git a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/EndpointConfiguration.java b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/EndpointConfiguration.javaindex 48baa933ef..1af943fca5 100644--- a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/EndpointConfiguration.java+++ b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/EndpointConfiguration.java@@ -1,11 +1,14 @@package io.github.hectorvent.floci.services.apigateway.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;import java.util.ArrayList;import java.util.List;@JsonIgnoreProperties(ignoreUnknown = true)+@RegisterForReflectionpublic class EndpointConfiguration {private List<EndpointType> types = new ArrayList<>();diff --git a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/EndpointType.java b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/EndpointType.javaindex 551b098b2a..13d1b7db81 100644--- a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/EndpointType.java+++ b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/EndpointType.java@@ -1,5 +1,8 @@package io.github.hectorvent.floci.services.apigateway.model;+import io.quarkus.runtime.annotations.RegisterForReflection;++@RegisterForReflectionpublic enum EndpointType {REGIONAL,EDGE,diff --git a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/Integration.java b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/Integration.javaindex 6a0618e04a..077a9234d4 100644--- a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/Integration.java+++ b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/Integration.java@@ -1,11 +1,14 @@package io.github.hectorvent.floci.services.apigateway.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;import java.util.HashMap;import java.util.Map;@JsonIgnoreProperties(ignoreUnknown = true)+@RegisterForReflectionpublic class Integration {private String type; // MOCK, HTTP, AWS, HTTP_PROXY, AWS_PROXYdiff --git a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/IntegrationResponse.java b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/IntegrationResponse.javaindex b2bf3b36af..b0d2ab2e1c 100644--- a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/IntegrationResponse.java+++ b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/IntegrationResponse.java@@ -1,10 +1,13 @@package io.github.hectorvent.floci.services.apigateway.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;import java.util.Map;@JsonIgnoreProperties(ignoreUnknown = true)+@RegisterForReflectionpublic record IntegrationResponse(String statusCode,String selectionPattern,diff --git a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/MethodConfig.java b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/MethodConfig.javaindex aecb91509c..8ca668ec42 100644--- a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/MethodConfig.java+++ b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/MethodConfig.java@@ -1,11 +1,14 @@package io.github.hectorvent.floci.services.apigateway.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;import java.util.HashMap;import java.util.Map;@JsonIgnoreProperties(ignoreUnknown = true)+@RegisterForReflectionpublic class MethodConfig {private String httpMethod;diff --git a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/MethodResponse.java b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/MethodResponse.javaindex 440fba6d1d..9fee2341cd 100644--- a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/MethodResponse.java+++ b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/MethodResponse.java@@ -1,10 +1,13 @@package io.github.hectorvent.floci.services.apigateway.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;import java.util.Map;@JsonIgnoreProperties(ignoreUnknown = true)+@RegisterForReflectionpublic record MethodResponse(String statusCode,Map<String, Boolean> responseParametersdiff --git a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/MethodSetting.java b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/MethodSetting.javaindex c17b6bd696..afbbe0262c 100644--- a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/MethodSetting.java+++ b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/MethodSetting.java@@ -1,5 +1,7 @@package io.github.hectorvent.floci.services.apigateway.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;/**@@ -14,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;* mean "no override").*/@JsonIgnoreProperties(ignoreUnknown = true)+@RegisterForReflectionpublic class MethodSetting {private static final int UNSET_THROTTLING_BURST_LIMIT = -1;diff --git a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/RestApi.java b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/RestApi.javaindex 4f54cdcba4..efa73b75c4 100644--- a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/RestApi.java+++ b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/RestApi.java@@ -1,11 +1,14 @@package io.github.hectorvent.floci.services.apigateway.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;import java.util.HashMap;import java.util.Map;@JsonIgnoreProperties(ignoreUnknown = true)+@RegisterForReflectionpublic class RestApi {private String id;diff --git a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/Stage.java b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/Stage.javaindex 9cce96c04a..0bb560ce84 100644--- a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/Stage.java+++ b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/Stage.java@@ -1,11 +1,14 @@package io.github.hectorvent.floci.services.apigateway.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;import java.util.HashMap;import java.util.Map;@JsonIgnoreProperties(ignoreUnknown = true)+@RegisterForReflectionpublic class Stage {private String stageName;diff --git a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/ThrottleSettings.java b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/ThrottleSettings.javaindex 790d7add70..18d2f84465 100644--- a/src/main/java/io/github/hectorvent/floci/services/apigateway/model/ThrottleSettings.java+++ b/src/main/java/io/github/hectorvent/floci/services/apigateway/model/ThrottleSettings.java@@ -1,8 +1,11 @@package io.github.hectorvent.floci.services.apigateway.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;@JsonIgnoreProperties(ignoreUnknown = true)+@RegisterForReflectionpublic class ThrottleSettings {private Integer burstLimit = 5000;diff --git a/src/main/java/io/github/hectorvent/floci/services/appsync/model/AuthenticationType.java b/src/main/java/io/github/hectorvent/floci/services/appsync/model/AuthenticationType.javaindex 31ceb410f1..f460a7d3d2 100644--- a/src/main/java/io/github/hectorvent/floci/services/appsync/model/AuthenticationType.java+++ b/src/main/java/io/github/hectorvent/floci/services/appsync/model/AuthenticationType.java@@ -1,5 +1,8 @@package io.github.hectorvent.floci.services.appsync.model;+import io.quarkus.runtime.annotations.RegisterForReflection;++@RegisterForReflectionpublic enum AuthenticationType {API_KEY,AWS_IAM,diff --git a/src/main/java/io/github/hectorvent/floci/services/appsync/model/DataSourceType.java b/src/main/java/io/github/hectorvent/floci/services/appsync/model/DataSourceType.javaindex 529caeb030..597b247849 100644--- a/src/main/java/io/github/hectorvent/floci/services/appsync/model/DataSourceType.java+++ b/src/main/java/io/github/hectorvent/floci/services/appsync/model/DataSourceType.java@@ -1,5 +1,8 @@package io.github.hectorvent.floci.services.appsync.model;+import io.quarkus.runtime.annotations.RegisterForReflection;++@RegisterForReflectionpublic enum DataSourceType {NONE,AWS_LAMBDA,diff --git a/src/main/java/io/github/hectorvent/floci/services/appsync/model/ResolverKind.java b/src/main/java/io/github/hectorvent/floci/services/appsync/model/ResolverKind.javaindex 7e06bb7b31..be57da373e 100644--- a/src/main/java/io/github/hectorvent/floci/services/appsync/model/ResolverKind.java+++ b/src/main/java/io/github/hectorvent/floci/services/appsync/model/ResolverKind.java@@ -1,5 +1,8 @@package io.github.hectorvent.floci.services.appsync.model;+import io.quarkus.runtime.annotations.RegisterForReflection;++@RegisterForReflectionpublic enum ResolverKind {UNIT,PIPELINEdiff --git a/src/main/java/io/github/hectorvent/floci/services/appsync/model/ResolverRuntimeName.java b/src/main/java/io/github/hectorvent/floci/services/appsync/model/ResolverRuntimeName.javaindex a3c280bdbf..a3f310ed2b 100644--- a/src/main/java/io/github/hectorvent/floci/services/appsync/model/ResolverRuntimeName.java+++ b/src/main/java/io/github/hectorvent/floci/services/appsync/model/ResolverRuntimeName.java@@ -1,5 +1,8 @@package io.github.hectorvent.floci.services.appsync.model;+import io.quarkus.runtime.annotations.RegisterForReflection;++@RegisterForReflectionpublic enum ResolverRuntimeName {APPSYNC_JS,VTLdiff --git a/src/main/java/io/github/hectorvent/floci/services/appsync/model/SchemaCreationStatusType.java b/src/main/java/io/github/hectorvent/floci/services/appsync/model/SchemaCreationStatusType.javaindex e36688eead..5af4355dd1 100644--- a/src/main/java/io/github/hectorvent/floci/services/appsync/model/SchemaCreationStatusType.java+++ b/src/main/java/io/github/hectorvent/floci/services/appsync/model/SchemaCreationStatusType.java@@ -1,5 +1,8 @@package io.github.hectorvent.floci.services.appsync.model;+import io.quarkus.runtime.annotations.RegisterForReflection;++@RegisterForReflectionpublic enum SchemaCreationStatusType {PROCESSING,ACTIVE,diff --git a/src/main/java/io/github/hectorvent/floci/services/appsync/model/TypeFormat.java b/src/main/java/io/github/hectorvent/floci/services/appsync/model/TypeFormat.javaindex 3809154ee8..275856c575 100644--- a/src/main/java/io/github/hectorvent/floci/services/appsync/model/TypeFormat.java+++ b/src/main/java/io/github/hectorvent/floci/services/appsync/model/TypeFormat.java@@ -1,5 +1,8 @@package io.github.hectorvent.floci.services.appsync.model;+import io.quarkus.runtime.annotations.RegisterForReflection;++@RegisterForReflectionpublic enum TypeFormat {SDL,JSONdiff --git a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/CacheBehavior.java b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/CacheBehavior.javaindex 0f8b84363b..354c8f2b52 100644--- a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/CacheBehavior.java+++ b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/CacheBehavior.java@@ -1,8 +1,11 @@package io.github.hectorvent.floci.services.cloudfront.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.util.List;import java.util.Map;+@RegisterForReflectionpublic class CacheBehavior {private String pathPattern;diff --git a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/CachePolicy.java b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/CachePolicy.javaindex 0d783654b9..a3bd6cc3e1 100644--- a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/CachePolicy.java+++ b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/CachePolicy.java@@ -1,8 +1,11 @@package io.github.hectorvent.floci.services.cloudfront.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;import java.util.Map;+@RegisterForReflectionpublic class CachePolicy {private String id;diff --git a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/CloudFrontFunction.java b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/CloudFrontFunction.javaindex eeaf2336a8..0aa508e620 100644--- a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/CloudFrontFunction.java+++ b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/CloudFrontFunction.java@@ -1,7 +1,10 @@package io.github.hectorvent.floci.services.cloudfront.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;+@RegisterForReflectionpublic class CloudFrontFunction {private String name;diff --git a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/CloudFrontOriginAccessIdentity.java b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/CloudFrontOriginAccessIdentity.javaindex c3f04c88f9..7a07fbd418 100644--- a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/CloudFrontOriginAccessIdentity.java+++ b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/CloudFrontOriginAccessIdentity.java@@ -1,5 +1,8 @@package io.github.hectorvent.floci.services.cloudfront.model;+import io.quarkus.runtime.annotations.RegisterForReflection;++@RegisterForReflectionpublic class CloudFrontOriginAccessIdentity {private String id;diff --git a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/ContinuousDeploymentPolicy.java b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/ContinuousDeploymentPolicy.javaindex f8351d69e0..66bf322635 100644--- a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/ContinuousDeploymentPolicy.java+++ b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/ContinuousDeploymentPolicy.java@@ -1,8 +1,11 @@package io.github.hectorvent.floci.services.cloudfront.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;import java.util.List;+@RegisterForReflectionpublic class ContinuousDeploymentPolicy {private String id;diff --git a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/DefaultCacheBehavior.java b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/DefaultCacheBehavior.javaindex 9cb9528107..bb0edc802e 100644--- a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/DefaultCacheBehavior.java+++ b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/DefaultCacheBehavior.java@@ -1,8 +1,11 @@package io.github.hectorvent.floci.services.cloudfront.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.util.List;import java.util.Map;+@RegisterForReflectionpublic class DefaultCacheBehavior {private String targetOriginId;diff --git a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/Distribution.java b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/Distribution.javaindex eb51ad3db5..9c5a025378 100644--- a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/Distribution.java+++ b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/Distribution.java@@ -1,8 +1,11 @@package io.github.hectorvent.floci.services.cloudfront.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;import java.util.Map;+@RegisterForReflectionpublic class Distribution {private String id;diff --git a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/DistributionConfig.java b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/DistributionConfig.javaindex 9225c11dbc..5c4394475c 100644--- a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/DistributionConfig.java+++ b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/DistributionConfig.java@@ -1,8 +1,11 @@package io.github.hectorvent.floci.services.cloudfront.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.util.List;import java.util.Map;+@RegisterForReflectionpublic class DistributionConfig {private String callerReference;diff --git a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/FieldLevelEncryptionConfig.java b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/FieldLevelEncryptionConfig.javaindex cce56b46dc..bd23088408 100644--- a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/FieldLevelEncryptionConfig.java+++ b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/FieldLevelEncryptionConfig.java@@ -1,7 +1,10 @@package io.github.hectorvent.floci.services.cloudfront.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;+@RegisterForReflectionpublic class FieldLevelEncryptionConfig {private String id;diff --git a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/FieldLevelEncryptionProfile.java b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/FieldLevelEncryptionProfile.javaindex c96b7dfc16..4a82d99e9b 100644--- a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/FieldLevelEncryptionProfile.java+++ b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/FieldLevelEncryptionProfile.java@@ -1,7 +1,10 @@package io.github.hectorvent.floci.services.cloudfront.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;+@RegisterForReflectionpublic class FieldLevelEncryptionProfile {private String id;diff --git a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/Invalidation.java b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/Invalidation.javaindex 59e03fc2b6..084acb085d 100644--- a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/Invalidation.java+++ b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/Invalidation.java@@ -1,8 +1,11 @@package io.github.hectorvent.floci.services.cloudfront.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;import java.util.List;+@RegisterForReflectionpublic class Invalidation {private String id;diff --git a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/KeyGroup.java b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/KeyGroup.javaindex a14c386947..5426cb1a95 100644--- a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/KeyGroup.java+++ b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/KeyGroup.java@@ -1,8 +1,11 @@package io.github.hectorvent.floci.services.cloudfront.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;import java.util.List;+@RegisterForReflectionpublic class KeyGroup {private String id;diff --git a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/MonitoringSubscription.java b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/MonitoringSubscription.javaindex 1ac840e1c4..e82a7f2fde 100644--- a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/MonitoringSubscription.java+++ b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/MonitoringSubscription.java@@ -1,5 +1,8 @@package io.github.hectorvent.floci.services.cloudfront.model;+import io.quarkus.runtime.annotations.RegisterForReflection;++@RegisterForReflectionpublic class MonitoringSubscription {private String distributionId;diff --git a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/Origin.java b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/Origin.javaindex 945d16f1c1..e612731404 100644--- a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/Origin.java+++ b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/Origin.java@@ -1,8 +1,11 @@package io.github.hectorvent.floci.services.cloudfront.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.util.List;import java.util.Map;+@RegisterForReflectionpublic class Origin {private String id;diff --git a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/OriginAccessControl.java b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/OriginAccessControl.javaindex c39d0c25cf..ad0c6551e7 100644--- a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/OriginAccessControl.java+++ b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/OriginAccessControl.java@@ -1,7 +1,10 @@package io.github.hectorvent.floci.services.cloudfront.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;+@RegisterForReflectionpublic class OriginAccessControl {private String id;diff --git a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/OriginRequestPolicy.java b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/OriginRequestPolicy.javaindex 4c35f08177..2eeab0ab5c 100644--- a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/OriginRequestPolicy.java+++ b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/OriginRequestPolicy.java@@ -1,8 +1,11 @@package io.github.hectorvent.floci.services.cloudfront.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;import java.util.Map;+@RegisterForReflectionpublic class OriginRequestPolicy {private String id;diff --git a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/PublicKey.java b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/PublicKey.javaindex c2737dab22..286f8449f6 100644--- a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/PublicKey.java+++ b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/PublicKey.java@@ -1,7 +1,10 @@package io.github.hectorvent.floci.services.cloudfront.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;+@RegisterForReflectionpublic class PublicKey {private String id;diff --git a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/RealtimeLogConfig.java b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/RealtimeLogConfig.javaindex cfb6433214..ea5ea84631 100644--- a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/RealtimeLogConfig.java+++ b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/RealtimeLogConfig.java@@ -1,8 +1,11 @@package io.github.hectorvent.floci.services.cloudfront.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.util.List;import java.util.Map;+@RegisterForReflectionpublic class RealtimeLogConfig {private String arn;diff --git a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/ResponseHeadersPolicy.java b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/ResponseHeadersPolicy.javaindex fa31e298e1..ed55316895 100644--- a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/ResponseHeadersPolicy.java+++ b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/ResponseHeadersPolicy.java@@ -1,8 +1,11 @@package io.github.hectorvent.floci.services.cloudfront.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;import java.util.Map;+@RegisterForReflectionpublic class ResponseHeadersPolicy {private String id;diff --git a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/StreamingDistribution.java b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/StreamingDistribution.javaindex dc91e68a92..dcc8d00ac3 100644--- a/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/StreamingDistribution.java+++ b/src/main/java/io/github/hectorvent/floci/services/cloudfront/model/StreamingDistribution.java@@ -1,8 +1,11 @@package io.github.hectorvent.floci.services.cloudfront.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;import java.util.List;+@RegisterForReflectionpublic class StreamingDistribution {private String id;diff --git a/src/main/java/io/github/hectorvent/floci/services/cognito/model/RevokedTokenInfo.java b/src/main/java/io/github/hectorvent/floci/services/cognito/model/RevokedTokenInfo.javaindex 097673c6d6..ac77da831b 100644--- a/src/main/java/io/github/hectorvent/floci/services/cognito/model/RevokedTokenInfo.java+++ b/src/main/java/io/github/hectorvent/floci/services/cognito/model/RevokedTokenInfo.java@@ -1,5 +1,7 @@package io.github.hectorvent.floci.services.cognito.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import com.fasterxml.jackson.annotation.JsonCreator;import com.fasterxml.jackson.annotation.JsonProperty;@@ -7,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;* Information about a revoked token for tracking and validation purposes.* Used to implement AWS Cognito AdminUserGlobalSignOut token revocation behavior.*/+@RegisterForReflectionpublic class RevokedTokenInfo {private final String jti;diff --git a/src/main/java/io/github/hectorvent/floci/services/iot/model/IotCertificate.java b/src/main/java/io/github/hectorvent/floci/services/iot/model/IotCertificate.javaindex 5f8a03694d..0343a5051e 100644--- a/src/main/java/io/github/hectorvent/floci/services/iot/model/IotCertificate.java+++ b/src/main/java/io/github/hectorvent/floci/services/iot/model/IotCertificate.java@@ -1,9 +1,12 @@package io.github.hectorvent.floci.services.iot.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;import java.util.Map;import java.util.TreeMap;+@RegisterForReflectionpublic class IotCertificate {private String certificateId;private String certificateArn;diff --git a/src/main/java/io/github/hectorvent/floci/services/iot/model/IotJob.java b/src/main/java/io/github/hectorvent/floci/services/iot/model/IotJob.javaindex 505de8088d..20cd2700d7 100644--- a/src/main/java/io/github/hectorvent/floci/services/iot/model/IotJob.java+++ b/src/main/java/io/github/hectorvent/floci/services/iot/model/IotJob.java@@ -1,9 +1,12 @@package io.github.hectorvent.floci.services.iot.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;import java.util.ArrayList;import java.util.List;+@RegisterForReflectionpublic class IotJob {private String jobId;diff --git a/src/main/java/io/github/hectorvent/floci/services/iot/model/IotJobExecution.java b/src/main/java/io/github/hectorvent/floci/services/iot/model/IotJobExecution.javaindex e4ec88e60d..c6dd37fd3a 100644--- a/src/main/java/io/github/hectorvent/floci/services/iot/model/IotJobExecution.java+++ b/src/main/java/io/github/hectorvent/floci/services/iot/model/IotJobExecution.java@@ -1,9 +1,12 @@package io.github.hectorvent.floci.services.iot.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;import java.util.HashMap;import java.util.Map;+@RegisterForReflectionpublic class IotJobExecution {private String jobId;diff --git a/src/main/java/io/github/hectorvent/floci/services/iot/model/IotPolicy.java b/src/main/java/io/github/hectorvent/floci/services/iot/model/IotPolicy.javaindex 714940f1fb..35b8efb6cd 100644--- a/src/main/java/io/github/hectorvent/floci/services/iot/model/IotPolicy.java+++ b/src/main/java/io/github/hectorvent/floci/services/iot/model/IotPolicy.java@@ -1,11 +1,14 @@package io.github.hectorvent.floci.services.iot.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;import java.util.ArrayList;import java.util.List;import java.util.Map;import java.util.TreeMap;+@RegisterForReflectionpublic class IotPolicy {private String policyName;private String policyArn;@@ -30,6 +33,7 @@ public class IotPolicy {public Map<String, String> getTags() { return tags == null ? Map.of() : tags; }public void setTags(Map<String, String> tags) { this.tags = tags == null ? new TreeMap<>() : new TreeMap<>(tags); }+ @RegisterForReflectionpublic static class PolicyVersion {private String versionId;private String document;diff --git a/src/main/java/io/github/hectorvent/floci/services/iot/model/IotRetainedMessage.java b/src/main/java/io/github/hectorvent/floci/services/iot/model/IotRetainedMessage.javaindex ed594b7bba..fa90489954 100644--- a/src/main/java/io/github/hectorvent/floci/services/iot/model/IotRetainedMessage.java+++ b/src/main/java/io/github/hectorvent/floci/services/iot/model/IotRetainedMessage.java@@ -1,7 +1,10 @@package io.github.hectorvent.floci.services.iot.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;+@RegisterForReflectionpublic class IotRetainedMessage {private String topic;private String payload;diff --git a/src/main/java/io/github/hectorvent/floci/services/iot/model/IotShadow.java b/src/main/java/io/github/hectorvent/floci/services/iot/model/IotShadow.javaindex b59f051c9c..1e5391ff4a 100644--- a/src/main/java/io/github/hectorvent/floci/services/iot/model/IotShadow.java+++ b/src/main/java/io/github/hectorvent/floci/services/iot/model/IotShadow.java@@ -1,5 +1,8 @@package io.github.hectorvent.floci.services.iot.model;+import io.quarkus.runtime.annotations.RegisterForReflection;++@RegisterForReflectionpublic class IotShadow {private String thingName;private String shadowName;diff --git a/src/main/java/io/github/hectorvent/floci/services/iot/model/IotThingGroup.java b/src/main/java/io/github/hectorvent/floci/services/iot/model/IotThingGroup.javaindex d6b837733b..25f19676b5 100644--- a/src/main/java/io/github/hectorvent/floci/services/iot/model/IotThingGroup.java+++ b/src/main/java/io/github/hectorvent/floci/services/iot/model/IotThingGroup.java@@ -1,9 +1,12 @@package io.github.hectorvent.floci.services.iot.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;import java.util.HashMap;import java.util.Map;+@RegisterForReflectionpublic class IotThingGroup {private String thingGroupName;diff --git a/src/main/java/io/github/hectorvent/floci/services/iot/model/IotThingType.java b/src/main/java/io/github/hectorvent/floci/services/iot/model/IotThingType.javaindex 45766009e0..9d3057c975 100644--- a/src/main/java/io/github/hectorvent/floci/services/iot/model/IotThingType.java+++ b/src/main/java/io/github/hectorvent/floci/services/iot/model/IotThingType.java@@ -1,9 +1,12 @@package io.github.hectorvent.floci.services.iot.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;import java.util.ArrayList;import java.util.List;+@RegisterForReflectionpublic class IotThingType {private String thingTypeName;diff --git a/src/main/java/io/github/hectorvent/floci/services/iot/model/IotTopicRule.java b/src/main/java/io/github/hectorvent/floci/services/iot/model/IotTopicRule.javaindex 0512ca5f71..a71527d849 100644--- a/src/main/java/io/github/hectorvent/floci/services/iot/model/IotTopicRule.java+++ b/src/main/java/io/github/hectorvent/floci/services/iot/model/IotTopicRule.java@@ -1,9 +1,12 @@package io.github.hectorvent.floci.services.iot.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;import java.util.Map;import java.util.TreeMap;+@RegisterForReflectionpublic class IotTopicRule {private String ruleName;private String ruleArn;diff --git a/src/main/java/io/github/hectorvent/floci/services/iot/model/Thing.java b/src/main/java/io/github/hectorvent/floci/services/iot/model/Thing.javaindex 9cae2f8c17..4554081a3c 100644--- a/src/main/java/io/github/hectorvent/floci/services/iot/model/Thing.java+++ b/src/main/java/io/github/hectorvent/floci/services/iot/model/Thing.java@@ -1,9 +1,12 @@package io.github.hectorvent.floci.services.iot.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;import java.util.HashMap;import java.util.Map;+@RegisterForReflectionpublic class Thing {private String thingName;diff --git a/src/main/java/io/github/hectorvent/floci/services/kinesis/model/KinesisShard.java b/src/main/java/io/github/hectorvent/floci/services/kinesis/model/KinesisShard.javaindex 97b2ce4fac..1d088ceb51 100644--- a/src/main/java/io/github/hectorvent/floci/services/kinesis/model/KinesisShard.java+++ b/src/main/java/io/github/hectorvent/floci/services/kinesis/model/KinesisShard.java@@ -51,6 +51,9 @@ public class KinesisShard {public Instant getCreationTimestamp() { return creationTimestamp; }public void setCreationTimestamp(Instant timestamp) { this.creationTimestamp = timestamp; }+ @RegisterForReflectionpublic record HashKeyRange(String startingHashKey, String endingHashKey) {}++ @RegisterForReflectionpublic record SequenceNumberRange(String startingSequenceNumber, String endingSequenceNumber) {}}diff --git a/src/main/java/io/github/hectorvent/floci/services/memorydb/model/Endpoint.java b/src/main/java/io/github/hectorvent/floci/services/memorydb/model/Endpoint.javaindex 8fd8ffc9c7..7d0ffbbf8b 100644--- a/src/main/java/io/github/hectorvent/floci/services/memorydb/model/Endpoint.java+++ b/src/main/java/io/github/hectorvent/floci/services/memorydb/model/Endpoint.java@@ -1,3 +1,6 @@package io.github.hectorvent.floci.services.memorydb.model;+import io.quarkus.runtime.annotations.RegisterForReflection;++@RegisterForReflectionpublic record Endpoint(String address, int port) {}diff --git a/src/main/java/io/github/hectorvent/floci/services/route53/model/AliasTarget.java b/src/main/java/io/github/hectorvent/floci/services/route53/model/AliasTarget.javaindex 511e7ece8f..76340f8368 100644--- a/src/main/java/io/github/hectorvent/floci/services/route53/model/AliasTarget.java+++ b/src/main/java/io/github/hectorvent/floci/services/route53/model/AliasTarget.java@@ -1,5 +1,8 @@package io.github.hectorvent.floci.services.route53.model;+import io.quarkus.runtime.annotations.RegisterForReflection;++@RegisterForReflectionpublic class AliasTarget {private String hostedZoneId;diff --git a/src/main/java/io/github/hectorvent/floci/services/route53/model/ChangeInfo.java b/src/main/java/io/github/hectorvent/floci/services/route53/model/ChangeInfo.javaindex 14523ff1c2..e3fc5c6e1d 100644--- a/src/main/java/io/github/hectorvent/floci/services/route53/model/ChangeInfo.java+++ b/src/main/java/io/github/hectorvent/floci/services/route53/model/ChangeInfo.java@@ -1,5 +1,8 @@package io.github.hectorvent.floci.services.route53.model;+import io.quarkus.runtime.annotations.RegisterForReflection;++@RegisterForReflectionpublic class ChangeInfo {private String id;diff --git a/src/main/java/io/github/hectorvent/floci/services/route53/model/HealthCheck.java b/src/main/java/io/github/hectorvent/floci/services/route53/model/HealthCheck.javaindex 9d3b288edf..5a887d6067 100644--- a/src/main/java/io/github/hectorvent/floci/services/route53/model/HealthCheck.java+++ b/src/main/java/io/github/hectorvent/floci/services/route53/model/HealthCheck.java@@ -1,5 +1,8 @@package io.github.hectorvent.floci.services.route53.model;+import io.quarkus.runtime.annotations.RegisterForReflection;++@RegisterForReflectionpublic class HealthCheck {private String id;diff --git a/src/main/java/io/github/hectorvent/floci/services/route53/model/HealthCheckConfig.java b/src/main/java/io/github/hectorvent/floci/services/route53/model/HealthCheckConfig.javaindex 0b9d47ddaf..7cf2ff3c5d 100644--- a/src/main/java/io/github/hectorvent/floci/services/route53/model/HealthCheckConfig.java+++ b/src/main/java/io/github/hectorvent/floci/services/route53/model/HealthCheckConfig.java@@ -1,5 +1,8 @@package io.github.hectorvent.floci.services.route53.model;+import io.quarkus.runtime.annotations.RegisterForReflection;++@RegisterForReflectionpublic class HealthCheckConfig {private String type;diff --git a/src/main/java/io/github/hectorvent/floci/services/route53/model/HostedZone.java b/src/main/java/io/github/hectorvent/floci/services/route53/model/HostedZone.javaindex 5845dad481..711dc12277 100644--- a/src/main/java/io/github/hectorvent/floci/services/route53/model/HostedZone.java+++ b/src/main/java/io/github/hectorvent/floci/services/route53/model/HostedZone.java@@ -1,5 +1,8 @@package io.github.hectorvent.floci.services.route53.model;+import io.quarkus.runtime.annotations.RegisterForReflection;++@RegisterForReflectionpublic class HostedZone {private String id;diff --git a/src/main/java/io/github/hectorvent/floci/services/route53/model/ResourceRecord.java b/src/main/java/io/github/hectorvent/floci/services/route53/model/ResourceRecord.javaindex 16278154da..1e2bf4c867 100644--- a/src/main/java/io/github/hectorvent/floci/services/route53/model/ResourceRecord.java+++ b/src/main/java/io/github/hectorvent/floci/services/route53/model/ResourceRecord.java@@ -1,5 +1,8 @@package io.github.hectorvent.floci.services.route53.model;+import io.quarkus.runtime.annotations.RegisterForReflection;++@RegisterForReflectionpublic class ResourceRecord {private String value;diff --git a/src/main/java/io/github/hectorvent/floci/services/route53/model/ResourceRecordSet.java b/src/main/java/io/github/hectorvent/floci/services/route53/model/ResourceRecordSet.javaindex 13f5c1c636..f51b1a43c7 100644--- a/src/main/java/io/github/hectorvent/floci/services/route53/model/ResourceRecordSet.java+++ b/src/main/java/io/github/hectorvent/floci/services/route53/model/ResourceRecordSet.java@@ -1,7 +1,10 @@package io.github.hectorvent.floci.services.route53.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.util.List;+@RegisterForReflectionpublic class ResourceRecordSet {private String name;diff --git a/src/main/java/io/github/hectorvent/floci/services/s3/model/ObjectLockRetention.java b/src/main/java/io/github/hectorvent/floci/services/s3/model/ObjectLockRetention.javaindex db838aca00..6deac86d58 100644--- a/src/main/java/io/github/hectorvent/floci/services/s3/model/ObjectLockRetention.java+++ b/src/main/java/io/github/hectorvent/floci/services/s3/model/ObjectLockRetention.java@@ -1,3 +1,6 @@package io.github.hectorvent.floci.services.s3.model;+import io.quarkus.runtime.annotations.RegisterForReflection;++@RegisterForReflectionpublic record ObjectLockRetention(String mode, String unit, int value) {}diff --git a/src/main/java/io/github/hectorvent/floci/services/secretsmanager/model/Secret.java b/src/main/java/io/github/hectorvent/floci/services/secretsmanager/model/Secret.javaindex 1d61645293..3ca1878ba0 100644--- a/src/main/java/io/github/hectorvent/floci/services/secretsmanager/model/Secret.java+++ b/src/main/java/io/github/hectorvent/floci/services/secretsmanager/model/Secret.java@@ -29,6 +29,7 @@ public class Secret {private Instant lastRotatedDate;private Instant nextRotationDate;+ @RegisterForReflectionpublic record RotationRules(@JsonProperty("AutomaticallyAfterDays") Integer automaticallyAfterDays,@JsonProperty("Duration") String duration,@@ -38,6 +39,7 @@ public class Secret {public Secret() {}+ @RegisterForReflectionpublic record Tag(@JsonProperty("Key") String key,@JsonProperty("Value") String value) {diff --git a/src/main/java/io/github/hectorvent/floci/services/transfer/model/HomeDirectoryMapping.java b/src/main/java/io/github/hectorvent/floci/services/transfer/model/HomeDirectoryMapping.javaindex 2874e72b7b..c004d4264f 100644--- a/src/main/java/io/github/hectorvent/floci/services/transfer/model/HomeDirectoryMapping.java+++ b/src/main/java/io/github/hectorvent/floci/services/transfer/model/HomeDirectoryMapping.java@@ -1,5 +1,8 @@package io.github.hectorvent.floci.services.transfer.model;+import io.quarkus.runtime.annotations.RegisterForReflection;++@RegisterForReflectionpublic class HomeDirectoryMapping {private String entry;diff --git a/src/main/java/io/github/hectorvent/floci/services/transfer/model/Server.java b/src/main/java/io/github/hectorvent/floci/services/transfer/model/Server.javaindex f479cdd591..0ae9a8df60 100644--- a/src/main/java/io/github/hectorvent/floci/services/transfer/model/Server.java+++ b/src/main/java/io/github/hectorvent/floci/services/transfer/model/Server.java@@ -1,9 +1,12 @@package io.github.hectorvent.floci.services.transfer.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;import java.util.List;import java.util.Map;+@RegisterForReflectionpublic class Server {private String serverId;diff --git a/src/main/java/io/github/hectorvent/floci/services/transfer/model/SshPublicKey.java b/src/main/java/io/github/hectorvent/floci/services/transfer/model/SshPublicKey.javaindex 132d4d469b..bee2de19d4 100644--- a/src/main/java/io/github/hectorvent/floci/services/transfer/model/SshPublicKey.java+++ b/src/main/java/io/github/hectorvent/floci/services/transfer/model/SshPublicKey.java@@ -1,7 +1,10 @@package io.github.hectorvent.floci.services.transfer.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.time.Instant;+@RegisterForReflectionpublic class SshPublicKey {private String sshPublicKeyId;diff --git a/src/main/java/io/github/hectorvent/floci/services/transfer/model/User.java b/src/main/java/io/github/hectorvent/floci/services/transfer/model/User.javaindex 5295d5bb3f..348070645c 100644--- a/src/main/java/io/github/hectorvent/floci/services/transfer/model/User.java+++ b/src/main/java/io/github/hectorvent/floci/services/transfer/model/User.java@@ -1,8 +1,11 @@package io.github.hectorvent.floci.services.transfer.model;+import io.quarkus.runtime.annotations.RegisterForReflection;+import java.util.List;import java.util.Map;+@RegisterForReflectionpublic class User {private String userName;diff --git a/src/test/java/io/github/hectorvent/floci/core/storage/PersistedModelReflectionTest.java b/src/test/java/io/github/hectorvent/floci/core/storage/PersistedModelReflectionTest.javanew file mode 100644index 0000000000..d0772fc3ed--- /dev/null+++ b/src/test/java/io/github/hectorvent/floci/core/storage/PersistedModelReflectionTest.java@@ -0,0 +1,200 @@+package io.github.hectorvent.floci.core.storage;++import com.fasterxml.jackson.annotation.JsonIgnore;+import com.fasterxml.jackson.core.type.TypeReference;+import io.quarkus.runtime.annotations.RegisterForReflection;+import org.junit.jupiter.api.Test;++import java.lang.reflect.Field;+import java.lang.reflect.GenericArrayType;+import java.lang.reflect.Modifier;+import java.lang.reflect.ParameterizedType;+import java.lang.reflect.Type;+import java.lang.reflect.WildcardType;+import java.net.URI;+import java.nio.file.Files;+import java.nio.file.Path;+import java.util.ArrayDeque;+import java.util.ArrayList;+import java.util.Deque;+import java.util.LinkedHashSet;+import java.util.List;+import java.util.Map;+import java.util.Set;+import java.util.stream.Stream;++import static org.junit.jupiter.api.Assertions.assertFalse;+import static org.junit.jupiter.api.Assertions.assertTrue;++/**+ * Guards against the native-image persistence bug class fixed in PR #1695: every type+ * reachable from a {@link StorageFactory#create} {@code TypeReference<Map<String, V>>}+ * must carry {@code @RegisterForReflection} (directly or via a {@code targets = ...}+ * registration), or native-image builds fail to deserialize persisted state on restart.+ *+ * <p>Persistence roots are detected statically: anonymous {@link TypeReference} subclasses+ * whose enclosing class owns a {@link StorageBackend}/{@link StorageBackedMap} field or a+ * {@link StorageFactory} constructor parameter, and whose captured type has the persistence+ * shape {@code Map<String, V>}. The reachable graph then follows non-static, non-transient,+ * non-{@code @JsonIgnore} fields (including generic type arguments and superclasses) within+ * the project package.+ */+class PersistedModelReflectionTest {++ private static final String BASE_PACKAGE = "io.github.hectorvent.floci";++ @Test+ void persistedTypesAreRegisteredForReflection() throws Exception {+ List<Class<?>> projectClasses = loadProjectClasses();+ assertFalse(projectClasses.isEmpty(), "Project class scan found nothing — scan is broken");++ Set<Class<?>> registered = collectRegistered(projectClasses);+ Set<Class<?>> roots = findPersistenceRoots(projectClasses);+ assertFalse(roots.isEmpty(), "No persistence roots found — root detection is broken");++ Set<Class<?>> reachable = walkReachable(roots);+ List<String> violations = reachable.stream()+ .filter(c -> !c.isInterface())+ .filter(c -> !registered.contains(c))+ .map(Class::getName)+ .sorted()+ .toList();++ assertTrue(violations.isEmpty(), () ->+ "Types reachable from persisted storage are missing @RegisterForReflection"+ + " (native-image persistence breaks on restart without it):\n "+ + String.join("\n ", violations));+ }++ private List<Class<?>> loadProjectClasses() throws Exception {+ URI codeSource = StorageFactory.class.getProtectionDomain().getCodeSource().getLocation().toURI();+ Path classesDir = Path.of(codeSource);+ List<Class<?>> classes = new ArrayList<>();+ try (Stream<Path> paths = Files.walk(classesDir)) {+ paths.filter(p -> p.toString().endsWith(".class"))+ .forEach(p -> {+ String name = classesDir.relativize(p).toString()+ .replace(java.io.File.separatorChar, '.')+ .replaceAll("\\.class$", "");+ if (!name.startsWith(BASE_PACKAGE)) {+ return;+ }+ try {+ classes.add(Class.forName(name, false, getClass().getClassLoader()));+ } catch (Throwable ignored) {+ // Optional dependencies may be absent at test time; such classes+ // cannot host persisted state reachable from a loadable root.+ }+ });+ }+ return classes;+ }++ private Set<Class<?>> collectRegistered(List<Class<?>> projectClasses) {+ Set<Class<?>> registered = new LinkedHashSet<>();+ for (Class<?> c : projectClasses) {+ RegisterForReflection annotation = c.getAnnotation(RegisterForReflection.class);+ if (annotation == null) {+ continue;+ }+ registered.add(c);+ for (Class<?> target : annotation.targets()) {+ registered.add(target);+ }+ }+ return registered;+ }++ private Set<Class<?>> findPersistenceRoots(List<Class<?>> projectClasses) {+ Set<Class<?>> roots = new LinkedHashSet<>();+ for (Class<?> c : projectClasses) {+ if (!TypeReference.class.isAssignableFrom(c) || c == TypeReference.class) {+ continue;+ }+ Class<?> enclosing = c.getEnclosingClass();+ if (enclosing == null || !ownsStorage(enclosing)) {+ continue;+ }+ Type captured = capturedType(c);+ if (captured instanceof ParameterizedType map+ && map.getRawType() == Map.class+ && map.getActualTypeArguments()[0] == String.class) {+ collectProjectTypes(map.getActualTypeArguments()[1], roots);+ }+ }+ return roots;+ }++ private static boolean ownsStorage(Class<?> enclosing) {+ for (Class<?> c = enclosing; c != null && c.getName().startsWith(BASE_PACKAGE); c = c.getSuperclass()) {+ for (Field f : c.getDeclaredFields()) {+ if (f.getType() == StorageBackend.class || f.getType() == StorageBackedMap.class) {+ return true;+ }+ }+ for (var constructor : c.getDeclaredConstructors()) {+ for (Class<?> param : constructor.getParameterTypes()) {+ if (param == StorageFactory.class) {+ return true;+ }+ }+ }+ }+ return false;+ }++ private static Type capturedType(Class<?> typeReferenceSubclass) {+ Type superType = typeReferenceSubclass.getGenericSuperclass();+ if (superType instanceof ParameterizedType p && p.getRawType() == TypeReference.class) {+ return p.getActualTypeArguments()[0];+ }+ return null;+ }++ private Set<Class<?>> walkReachable(Set<Class<?>> roots) {+ Set<Class<?>> visited = new LinkedHashSet<>();+ Deque<Class<?>> queue = new ArrayDeque<>(roots);+ while (!queue.isEmpty()) {+ Class<?> c = queue.pop();+ if (!visited.add(c) || c.isEnum()) {+ continue;+ }+ for (Field f : c.getDeclaredFields()) {+ if (Modifier.isStatic(f.getModifiers())+ || Modifier.isTransient(f.getModifiers())+ || f.isAnnotationPresent(JsonIgnore.class)) {+ continue;+ }+ Set<Class<?>> fieldTypes = new LinkedHashSet<>();+ collectProjectTypes(f.getGenericType(), fieldTypes);+ queue.addAll(fieldTypes);+ }+ Class<?> superclass = c.getSuperclass();+ if (superclass != null && superclass.getName().startsWith(BASE_PACKAGE)) {+ queue.add(superclass);+ }+ }+ return visited;+ }++ private static void collectProjectTypes(Type type, Set<Class<?>> out) {+ if (type instanceof Class<?> c) {+ if (c.isArray()) {+ collectProjectTypes(c.getComponentType(), out);+ } else if (c.getName().startsWith(BASE_PACKAGE)) {+ out.add(c);+ }+ } else if (type instanceof ParameterizedType p) {+ collectProjectTypes(p.getRawType(), out);+ for (Type arg : p.getActualTypeArguments()) {+ collectProjectTypes(arg, out);+ }+ } else if (type instanceof GenericArrayType g) {+ collectProjectTypes(g.getGenericComponentType(), out);+ } else if (type instanceof WildcardType w) {+ for (Type bound : w.getUpperBounds()) {+ collectProjectTypes(bound, out);+ }+ }+ }+}