* test(elbv2): cover SetSubnets with neither Subnets nor SubnetMappings SetSubnets takes Subnets or SubnetMappings, and AWS refuses a request with neither. These tests pin that answer, which Floci does not give yet: a ValidationError with the CreateLoadBalancer message for the balancer's type, with the balancer left on its subnets and in its VPC, whether the two lists are left out or sent empty. They fail until the fix that follows. They also pin the paths that must keep working: a balancer that does not exist is reported first, a CloudFormation update that names neither leaves its kept balancer alone, and a rollback can still move a balancer an earlier version saved without subnets back onto none. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(elbv2): refuse SetSubnets with neither Subnets nor SubnetMappings A SetSubnets that named neither Subnets nor SubnetMappings answered success and left the load balancer in no Availability Zone, still in its VPC. The API reference says the request takes one or the other, and AWS answers a Network Load Balancer's with "ValidationError: At least one subnet must be specified", the message CreateLoadBalancer gives it. SetSubnets with neither now answers ValidationError and leaves the balancer on its subnets, with the message CreateLoadBalancer gives the balancer's type: "At least two subnets in two different Availability Zones must be specified" for an Application Load Balancer, "At least one subnet must be specified" for a Network or Gateway Load Balancer. A balancer that does not exist is still LoadBalancerNotFound, since the message depends on its type, and a request that names subnets is checked as before. The check runs in the new ElbV2Service.setRequestedSubnets, which the Query handler calls. ElbV2Service.setSubnets still takes an empty list: CloudFormation moves a kept balancer through it, never onto none on an update, and onto none on a rollback only for a balancer an earlier version saved without subnets, which rolls back as before. Follow-up to #6087. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * refactor(elbv2): keep the SetSubnets action check in the package Review follow-ups, no change in behaviour: - The action's entry point is now the package-private ElbV2Service.setSubnetsFromRequest, which only the Query handler calls; setRequestedSubnets read like a property setter. The CloudFormation provisioner, in another package, cannot reach it and keeps moving balancers through setSubnets. - Its Javadoc says why only an empty list is refused there: a request that names subnets is checked by setSubnets. The setSubnets and test Javadocs speak of a balancer an earlier Floci version saved without subnets. - The provisioner test of an update that names neither says the real reason the update must not call setSubnets: it would move the balancer onto none. - The docs line for SetSubnets gives both messages. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(elbv2): give the SetSubnets neither test the class's last order #6098 adds a test at @Order(79) earlier in ElbV2IntegrationTest, while this one stays the last method in the file at @Order(78). Once both land, whoever appends a test would read 78 and pick 79, so this one takes 80 and the last method keeps the highest order. The two tests are independent, so the order between them does not matter. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(elbv2): give the SetSubnets compat test its own order setSubnetsWithoutSubnets and createLoadBalancerWithoutSubnets in the compatibility suite's ElbV2Test both carried @Order(6), so JUnit's order between them was left to its tie-break. The SetSubnets test now has @Order(8), the first value not taken once #6098's @Order(7) test is in the class, so every order in the class is unique. The test stays where it is in the file: moving it below the create test would edit the lines #6098 added on main. The two tests create and delete their own balancers, so neither depends on running before the other. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> --------- Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
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_REGION |
us-east-1 |
Region the TestFixtures clients sign for |
AWS credentials are always test / test. Setting AWS_REGION=cn-north-1 (with Floci started
with FLOCI_DEFAULT_REGION=cn-north-1) runs the suite in the China partition; the nightly
Partition Compatibility workflow does exactly that, and tolerates only the failures listed in
.github/ci/compat-partition-allowlist-cn-north-1.txt. Tests that build their own client with an
explicit region keep that region.
STS presigned identity checks
StsPresignedIdentityTest checks user and role identity over HTTP/1.1 and HTTP/2.
Valid identity requests run in both modes. Forged signatures and changed bodies are
sent only when signature checking is enabled. To check signature refusal, start Floci
with FLOCI_AUTH_VALIDATE_SIGNATURES=true and pass the same setting to this test:
FLOCI_AUTH_VALIDATE_SIGNATURES=true mvn test -Dtest=StsPresignedIdentityTest
The test setting must match the server setting; it does not configure the server. The enabled mode also checks missing and incorrect temporary-session tokens.
Metric filter publishing checks
CloudWatchLogsMetricFilterTest and CloudFormationLogsMetricFilterTest run
with the rest of the suite. Against a server on another port:
# From compatibility-tests/sdk-test-java
FLOCI_ENDPOINT=http://127.0.0.1:18084 ../../mvnw test \
-Dtest=CloudWatchLogsMetricFilterTest,CloudFormationLogsMetricFilterTest
The publishing tests read their expected values from
src/test/resources/cloudwatchlogs/metric-filter-publishing-aws.json, a
byte-identical copy of the root fixture recorded from AWS. MetricFilterFixturePackagingTest
checks the copy loads from the classpath, and the root
CloudWatchLogsMetricFilterFixturePackagingTest fails when either SDK module
copy drifts from the root file. The SDK selects the CloudWatch JSON protocol;
MetricFilterQueryAssertions signs the same reads as legacy form-encoded Query
requests, so GetMetricStatistics and GetMetricData on both wire formats are
asserted against every statistic the fixture records (Sum, SampleCount, Minimum,
Maximum). Reads poll for the sample, since the server publishes it shortly after
PutLogEvents returns. Passing
these tests shows Floci matches the recorded values; it is not live AWS
verification. For the opt-in replay against AWS see ../sdk-test-python/README.md.
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