mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 15:49:33 -05:00
* fix(sqs): return MD5 of current request on FIFO dedup replay On a duplicate SendMessage within the 5-minute FIFO dedup window Floci returned the original message verbatim, including its cached MD5OfMessageBody and MD5OfMessageAttributes. AWS SDK clients validate those MD5s against the body and attributes they sent, so any time the second send differed from the first (or even when the first send had different attribute keys than the second's body alone) the SDK threw "MD5 returned by SQS does not match the calculation on the original request" and never delivered the message. AWS itself returns the original MessageId and SequenceNumber on dedup, but recomputes MD5s from the current request so the validation round-trips. Floci now does the same. A new SDK-driven integration test (sqs Java SDK at test scope) covers the dedup-replay case plus several standard/FIFO/binary/custom-type-name MD5 round-trips. Refs #768. * test(sqs): tighten dedup-replay MD5 test and drop redundant @Inject Address review feedback on #786: - Assert the second SendMessage returns the same MessageId and SequenceNumber as the first, so the test would catch a regression that silently disabled dedup (in which case the MD5 round-trip would also pass for the wrong reason). - Drop the redundant @Inject on the @ConfigProperty-injected field, matching the convention used in other Floci integration tests. * test(sqs): move FIFO MD5 SDK tests to compatibility-tests/sdk-test-java Address maintainer review on #786: - Drop the software.amazon.awssdk:sqs test-scope dependency from the main module's pom.xml. - Move SqsSdkMd5IntegrationTest to the compatibility-tests/sdk-test-java module as SqsMd5Test, where the existing AWS SDK v2 compatibility suite already lives. The test now follows that module's conventions (TestFixtures.sqsClient, AssertJ, lowerCamelCase method names, queue cleanup) and exercises the same scenarios: standard / FIFO / fair MD5 parity, binary and custom-type-name attributes, and the dedup-replay case that asserts the second SendMessage returns the original MessageId and SequenceNumber.
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