Skip to content

test: canonicalize S3 inbound adapter temp directory - #1657

Open
codingkiddo wants to merge 1 commit into
awspring:mainfrom
codingkiddo:fix/s3-inbound-canonical-temp-path
Open

test: canonicalize S3 inbound adapter temp directory#1657
codingkiddo wants to merge 1 commit into
awspring:mainfrom
codingkiddo:fix/s3-inbound-canonical-temp-path

Conversation

@codingkiddo

Copy link
Copy Markdown

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Canonicalize the temporary directory used by S3InboundChannelAdapterTests before creating the local download directory.

The test now resolves TEMPORARY_FOLDER with toRealPath(), ensuring that the path used when storing S3 remote-file metadata matches the canonical path later used by Spring Integration when reading the downloaded file.

💡 Motivation and Context

On macOS, JUnit may create temporary directories under /var/folders, while file canonicalization resolves the same location under /private/var/folders.

The S3 inbound synchronizer stores remote-file metadata using the original absolute path. Spring Integration later looks up that metadata using the canonical file path. Because the two paths differ, the metadata lookup fails and the following expected headers are missing:

  • file_remoteDirectory
  • file_remoteHostPort
  • file_remoteFile

Canonicalizing the temporary directory before configuring the inbound adapter keeps the metadata storage and lookup paths consistent.

💚 How did you test it?

Ran the focused failing test:

./mvnw \
  -pl spring-cloud-aws-s3 \
  -Dtest=S3InboundChannelAdapterTests \
  test

Ran the complete S3 module tests:

./mvnw -pl spring-cloud-aws-s3 test

Resumed the remaining Maven reactor build:

./mvnw package -rf :spring-cloud-aws-autoconfigure

The remaining reactor build completed successfully.

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • I updated reference documentation to reflect the change
  • All tests passing
  • No breaking changes

🔮 Next steps

None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant