Files
floci/compatibility-tests/sdk-test-java
Kenshin Okinaka 944f82a6a4 feat(ses): add v2 suppression list endpoints (#813)
* feat(ses): add v2 suppression list endpoints

Implements the v2 SES suppression list management plane at
/v2/email/suppression/addresses:

- PUT  /v2/email/suppression/addresses                 PutSuppressedDestination
- GET  /v2/email/suppression/addresses/{EmailAddress}  GetSuppressedDestination
- DELETE /v2/email/suppression/addresses/{EmailAddress} DeleteSuppressedDestination
- GET  /v2/email/suppression/addresses                 ListSuppressedDestinations
                                                       (repeated Reason filter)

Entries are persisted per region in ses-suppression.json. A repeat Put for
the same EmailAddress updates the existing entry's Reason and LastUpdateTime.
List responses are sorted by LastUpdateTime then EmailAddress for stable
output across runs.

Behaviour aligned with real AWS responses:

- EmailAddress is silently trimmed of leading/trailing whitespace on Put
  / Get / Delete; whitespace-only is rejected with BadRequestException.
- Reason validation errors use the AWS-canonical "1 validation error
  detected: Value at '<field>' failed to satisfy constraint: Member must
  satisfy enum value set: [BOUNCE, COMPLAINT]" wording, with the nested
  "Member must satisfy constraint: [...]" wrapping AWS emits for the
  list-typed reasons filter.
- ListSuppressedDestinations accepts a repeated Reason query param (the
  Java SDK's .reasons(...) varargs serialise this way) and applies
  OR-semantics across the supplied values.
- GetSuppressedDestination and DeleteSuppressedDestination return
  NotFoundException with "Email address <X> does not exist on your
  suppression list." for unknown addresses — Delete is not idempotent
  on AWS so floci matches.

SendEmail integration is intentionally out of scope: suppressed addresses
are still delivered locally so that existing send tests remain unaffected.
A follow-up PR can wire suppression checks into the send path along with
the PutAccount/ConfigurationSetSuppressionOptions configuration endpoints.

Tests:
- SesSuppressionV2IntegrationTest covers Put/Get/Delete lifecycle, List
  sort order, single- and multi-Reason filter (with OR semantics), Put
  updates, trim-on-Put, idempotent-Get-on-known, and validation errors.
- SesSuppressionListTest exercises the same surface through the Java SDK
  v2 SesV2Client.

* fix(ses): reject null and non-object bodies on PutSuppressedDestination

Jackson's NullNode.asText("default") returns the literal string "null"
rather than the default, so a body like
  {"EmailAddress": null, "Reason": "BOUNCE"}
silently stored an entry under the email address "null". Validate the
body is a JSON object via requireJsonObject and require both
EmailAddress and Reason to be present and textual via a new
readRequiredStringField helper.

SesSuppressionV2IntegrationTest gains three cases covering null
EmailAddress, null Reason, and a non-object root body.
2026-05-12 19:44:31 -05:00
..

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