Add tests for forbidden file and HTTP locations in CatalogUtils#4638
Add tests for forbidden file and HTTP locations in CatalogUtils#4638hemasrishalini wants to merge 2 commits into
Conversation
|
|
||
| Assertions.assertThatThrownBy( | ||
| () -> | ||
| CatalogUtils.validateLocationsForTableLike( |
There was a problem hiding this comment.
This is a correct test, but I'm not sure it is worth adding, TBH 🤷
In runtime, these locations would be rejected by PolarisServiceImpl.validateStorageConfig() and associated child location checks.
Do you actually have a use case where the exception triggered by this test happens in a deployed Polaris Server?
There was a problem hiding this comment.
@dimas-b Thanks for reviewing.
You're right that these locations would normally be validated earlier through PolarisServiceImpl.validateStorageConfig() and related checks.
My intention was to add coverage for the defensive validation that still exists in CatalogUtils.validateLocationsForTableLike(), since the method explicitly rejects file: and http: locations when FILE storage is not enabled. I thought it would help guard against regressions if the validation flow changes in the future.
That said, I understand the concern about the practical value of this path and am happy to follow your recommendation if you think this test isn't needed.
There was a problem hiding this comment.
Let's see what other reviewers think 🤔
Adds unit tests for CatalogUtils.validateLocationsForTableLike to ensure that:
This verifies enforcement of storage location validation when SUPPORTED_CATALOG_STORAGE_TYPES does not include FILE.
The tests cover the fallback validation path when no storage restrictions are resolved from entity hierarchy.
Checklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)