mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 06:00:46 -05:00
V2 SES already exposes ConfigurationSet event-destination CRUD via REST JSON; this PR adds the matching V1 Query actions (CreateConfigurationSetEventDestination / UpdateConfigurationSetEventDestination / DeleteConfigurationSetEventDestination) and extends DescribeConfigurationSet so V1 callers can round-trip their stored destinations. The service layer (`SesService.createConfigurationSetEventDestination` etc.) already had the persistence and validation logic, so most of the work is wire-format: parse V1 Query parameter shapes, render V1 XML responses, and route the new action names. - SesQueryHandler: three new Query actions plus `readEventDestination(params, prefix)` and `writeEventDestination` helpers. V1 wire field names use uppercase `ARN` / `NS` suffix variants (`SNSDestination.TopicARN`, `KinesisFirehoseDestination.IAMRoleARN` / `DeliveryStreamARN`, `CloudWatchDestination.DimensionConfigurations.member.N`) which are mapped onto the existing model classes; the `EventDestination.Enabled` default mirrors the V2 primitive-boolean default of `false` when omitted. - V1 event-type wire forms are lowercase camelCase (`send`, `complaint`, `renderingFailure`) while floci stores the V2 canonical form (SCREAMING_SNAKE). New `V1_EVENT_TYPE_TO_INTERNAL` / `INTERNAL_EVENT_TYPE_TO_V1` maps translate in both directions; unknown values pass through so the existing validate-against-VALID_EVENT_TYPES check still catches typos. - `handleDescribeConfigurationSet`: when `ConfigurationSetAttributeNames.member.N=eventDestinations` is requested, render the stored event destinations as a V1 XML block. Treat a null `ConfigurationSet.eventDestinations` list as empty when rendering, so a corrupted persisted JSON with `"EventDestinations": null` still produces an empty `<EventDestinations/>` container rather than NPE-ing. Other ConfigurationSet attribute names (trackingOptions, deliveryOptions, reputationOptions) remain unsupported and are silently ignored — they will land with their respective Put*Options PRs. The container is emitted even when the destination list is empty so the response depends only on the requested attributes. - `writeEventDestination`: skip destination blocks when required fields are blank (defensive belt-and-suspenders for any legacy state) and filter incomplete CloudWatch dimension members so partial members don't leak into the XML. - `SesService.validateEventDestination`: centralize required-field validation for SNS / Firehose / CloudWatch dimensions, so both V1 and V2 reject partial destinations at create/update time. Members with missing required fields now fail with a 400 `InvalidParameterValue` carrying the offending member index. - `AwsQueryController.SES_ACTIONS`: include the three new actions in the action-name → "email" service routing fallback so SigV4 requests whose credential scope doesn't pin the service still reach SES. Tests - `SesConfigurationSetEventDestinationV1IntegrationTest`: 15 cases covering create / describe-with-attribute / describe-without-attribute / describe-empty-attribute / duplicate / update / update-unknown / delete / delete-unknown / partial Firehose / partial CloudWatch dim / blank SNS TopicARN / action-name routing fallback when the Authorization header is absent. - `SesServiceEventDestinationTest`: 8 new unit cases for the centralized SNS / Firehose / CloudWatch dim validation, exercising validateEventDestination directly. - `compatibility-tests/sdk-test-java SesConfigurationSetEventDestinationTest`: extended to drive both V1 (SesClient) and V2 (SesV2Client) against a live Floci. Each protocol gets its own config set; nine new V1 tests mirror the V2 lifecycle plus partial-Firehose rejection.
sdk-test-java
Compatibility tests for Floci using the AWS SDK for Java v2 (2.31.8).
Runs 313 tests across 16 test classes against a live Floci instance — no mocks.
Services Covered
| Test class | Description |
|---|---|
SsmTest |
Parameter Store — put, get, path, tags |
SqsTest |
Queues, send/receive/delete, DLQ, visibility |
SnsTest |
Topics, subscriptions, publish, SQS delivery |
S3Test |
Buckets, objects, tagging, copy, multipart, batch delete |
DynamoDbTest |
Tables, CRUD, batch, TTL, tags, streams |
DynamoDbScanConditionTests |
Scan filter and condition expressions |
LambdaTest |
Create/invoke/update/delete functions |
IamTest |
Users, roles, policies, access keys |
StsTest |
GetCallerIdentity, AssumeRole, GetSessionToken |
SecretsManagerTest |
Create/get/put/list/delete secrets, versioning, tags |
KmsTest |
Keys, aliases, encrypt/decrypt, data keys, sign/verify |
CloudWatchTest |
PutMetricData, ListMetrics, GetMetricStatistics, alarms |
CloudFormationVirtualHostTests |
Virtual host style S3 access via CloudFormation |
ApigwSfnJsonataCrudlTests |
API Gateway + Step Functions JSONata CRUDL integration |
ApiGatewayV2WebSocketAndExtendedOpsTest |
API GW v2 WebSocket APIs, Update ops, Route/Integration Responses, Models, Tagging |
Ec2Tests |
EC2 instances, VPCs, security groups, subnets |
EcsTests |
ECS clusters, task definitions, services |
Adding a New Test
Create a standard JUnit 5 test class in src/test/java/com/floci/test/. Tests run against a live Floci instance using real AWS SDK clients.
Requirements
- Java 17+
- Maven
Running
# All tests
mvn test -q
# Specific test class
mvn test -Dtest=S3Test
# Via just (from compatibility-tests/)
just test-java
Configuration
| Variable | Default | Description |
|---|---|---|
FLOCI_ENDPOINT |
http://localhost:4566 |
Floci emulator endpoint |
AWS credentials are always test / test / us-east-1.
Docker
docker build -t floci-sdk-java .
docker run --rm --network host floci-sdk-java
# Custom endpoint (macOS/Windows)
docker run --rm -e FLOCI_ENDPOINT=http://host.docker.internal:4566 floci-sdk-java