mirror of
https://github.com/floci-io/floci.git
synced 2026-11-25 06:47:41 -05:00
Adds support for arn:aws:ses:<region>:<account>:template/<name> ARNs across TagResource / UntagResource / ListTagsForResource. Behaviour was verified against real AWS via aws sesv2 commands and aligned where it diverged. - EmailTemplate gains a tags field. CreateEmailTemplate accepts an optional Tags array; tag validation reuses validateTag(). - UpdateEmailTemplate intentionally preserves the existing tags so that AWS-style "tags only mutated via Tag/UntagResource" semantics hold. - GetEmailTemplate response surfaces stored tags. - Missing templates return NotFoundException with the AWS-canonical "No Template present with name: <name>" message — AWS uses the bare "Template" (not "EmailTemplate") for tag-endpoint lookups even though the SDK type is EmailTemplate. Resource-type-specific routing in the tag endpoints: - TagResource on a template ARN strictly validates ARN/signing region match (BadRequestException "Failed to tag resource" on mismatch), matching the existing ConfigurationSet behaviour. - UntagResource on a template ARN strictly validates ARN/signing region match (BadRequestException "Failed to untag resource"), whereas ConfigurationSet's lenient ARN-region lookup is preserved. AWS treats the two resource types asymmetrically here. - ListTagsForResource on a template ARN ignores the ARN region and resolves the template against the signing region. ConfigurationSet continues to route by ARN region. Three small refactors that fall out naturally from adding a second taggable resource: - Tag is promoted from ConfigurationSet.Tag to a top-level services/ses/model/Tag so EmailTemplate and the shared helpers no longer reference a Configuration-scoped name. JSON serialization is unchanged. - A private mergeTags(existing, incoming) helper centralizes the LinkedHashMap merge previously duplicated between tagConfigurationSet and tagEmailTemplate. - A private parseTagsArray(JsonNode) helper centralizes the JSON Tags array parse previously duplicated across createConfigurationSet, createEmailTemplate, and tagResource. The helper returns null for missing/null nodes; the required caller (tagResource) treats null as BadRequestException. Tests: - SesTagsV2IntegrationTest gains a template lifecycle case, a template-not-found assertion, and the two template-specific region-mismatch / signing-region-lookup cases. - SesTemplateV2IntegrationTest covers create-with-tags, list-via-tags endpoint, and update-preserves-tags round-trips. - SesTagResourceTest (Java SDK compat) exercises CreateEmailTemplate with Tags and the Tag/Untag lifecycle on the template ARN.
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