fix tests

This commit is contained in:
chrislu
2025-07-18 20:55:12 -07:00
parent af25f92e36
commit 8fb9df72ae
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -573,9 +573,9 @@ func mapValidationErrorToS3Error(err error) s3err.ErrorCode {
// This matches the test expectations
return s3err.ErrInvalidRequest
case errors.Is(err, ErrInvalidLegalHoldStatus):
// For invalid legal hold status, return InvalidRequest
// This matches the test expectations for invalid parameter values
return s3err.ErrInvalidRequest
// For invalid legal hold status in XML body, return MalformedXML
// AWS S3 treats invalid status values in XML as malformed content
return s3err.ErrMalformedXML
case errors.Is(err, ErrInvalidRetentionDateFormat):
// For malformed retention date format, return MalformedDate
// This matches the test expectations
+1 -1
View File
@@ -568,7 +568,7 @@ func TestMapValidationErrorToS3Error(t *testing.T) {
{
name: "ErrInvalidLegalHoldStatus",
inputError: ErrInvalidLegalHoldStatus,
expectedCode: s3err.ErrInvalidRequest,
expectedCode: s3err.ErrMalformedXML,
},
{
name: "ErrInvalidRetentionDateFormat",