refactor(ses): build not-null violations with SmithyValidationErrors (#6746)

The "Value at '<path>' failed to satisfy constraint: Member must not be
null" violation was still written by hand in 26 places across the SES
services and controllers. They now call
SmithyValidationErrors.notNullWithoutValue(path), keeping each site's
badRequest or validationError factory.

The length checks on websiteURL, additionalContactEmailAddresses and
certificateArn, which tested a lower and an upper bound side by side,
now go through SmithyValidationErrors.sizeOutOfRange.

The message text is unchanged, and the private wrappers stay because
their enum and other constraint callers still use them.
This commit is contained in:
Kenshin Okinaka authored and GitHub committed 2026-10-27 12:03:18 -04:00
1 parent afdd4b46ec
commit 24d989cb07
12 files changed
+56 -49

No files matched your search

@@ -117,6 +117,15 @@ class SesIdentityCertificateServiceTest {
() -> service.associate(DOMAIN, "alice@example.com", "not-an-arn", REGION));
}
@Test
void associate_overlongArnReportsTheLengthConstraint() {
String arn = CERT_ARN + "a".repeat(2049 - CERT_ARN.length());
assertBadRequest("1 validation error detected: Value at 'certificateArn' failed to satisfy constraint: "
+ "Member must have length less than or equal to 2048",
() -> service.associate(DOMAIN, "alice@example.com", arn, REGION));
}
@Test
void associate_missingIdentityIsNotFound() {
AwsException e = assertThrows(AwsException.class,