Files
floci/compatibility-tests/sdk-test-java
Facundo ParedesandFacundo Paredes ff61c2b2a5 feat(stepfunctions): describe a distributed Map run after it finishes (#2694)
* feat(stepfunctions): describe a distributed Map run after it finishes

DescribeMapRun was not implemented, and arn:aws:states:::aws-sdk:sfn:describeMapRun
reached the end of the dispatch chain in invokeResource, so a distributed Map could
not be inspected once it was over: the Map run ARN was minted from a fresh UUID,
written into the S3 manifest, returned in the Map result and then dropped.

A run is now retained where the ResultWriter mints that ARN, which is also the only
place an ASL author reads it. The manifest is no shortcut to the counters, since it
writes FAILED and PENDING as empty arrays and puts every item under SUCCEEDED, so
the run carries the item count taken where the iterations complete.

A Map fails on the first item that fails, so a retained run is one whose every item
succeeded. That fixes the status, both tolerances and the redrive counters at the
values us-east-1 reports for such a run, and leaves succeeded, total and
resultsWritten as the item count. An unbounded Map, which ASL spells as MaxConcurrency
0 or by omitting it, is reported as Integer.MAX_VALUE.

The Task integration recases the wire response rather than restating it, so the two
renderings of a run cannot drift, and renders both dates as the SDK's ISO-8601.

Closes #2671

* refactor(stepfunctions): close a Map run's window on the export that mints its ARN

recordMapRun sampled the wall clock and then folded the child timings into both
ends of the run's window, but the clock is read after MapIterationScheduler has
joined every child and after applyResultWriter has exported, so it is at or past
every child's stop. Math.max over the timings could therefore never move stop off
that sample, and the javadoc promised a last-item stop the code never computed.

The sampled value is the faithful one: AWS closes a Map run's window on the export
rather than on the last item, and the sample is taken immediately after it. Only
start is recovered from the timings, which is the one end the Map state records
nowhere else. DescribeMapRun returns the same startDate and stopDate as before.

* test(compatibility): cover DescribeMapRun through the AWS SFN SDK client

StepFunctionsDescribeMapRunIntegrationTest only exercises the endpoint via
RestAssured, leaving the SDK's own request serialization, endpoint routing
and response deserialization untested, contrary to AGENTS.md's rule that
management APIs be validated with AWS SDK clients.

---------

Co-authored-by: Facundo Paredes <25681464+facuparedes@users.noreply.github.com>
2026-08-29 00:05:50 -04:00
..

sdk-test-java

Compatibility tests for Floci using the AWS SDK for Java v2 (2.31.8).

Runs 352 tests across 17 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
AppSyncTest GraphQL API CRUDL, data sources, resolvers, functions, types, API keys, tags, schema validation
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