dimas-b commented on code in PR #1320: URL: https://github.com/apache/polaris/pull/1320#discussion_r2112021920
########## integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewIntegrationBase.java: ########## @@ -175,15 +184,83 @@ protected boolean overridesRequestedLocation() { return true; } - /** TODO: Unblock this test, see: https://github.com/apache/polaris/issues/1273 */ @Override @Test - @Disabled( - """ - Disabled because the behavior is not applicable to Polaris. - To unblock, update this to expect an exception and add a Polaris-specific test. - """) public void createViewWithCustomMetadataLocation() { - super.createViewWithCustomMetadataLocation(); + Assertions.assertThatThrownBy(super::createViewWithCustomMetadataLocation) + .isInstanceOf(ForbiddenException.class) + .hasMessageContaining("Forbidden: Invalid locations"); Review Comment: This change and the following test method LGTM because they assert existing Polaris behaviour. ########## integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewIntegrationBase.java: ########## @@ -175,15 +184,83 @@ protected boolean overridesRequestedLocation() { return true; } - /** TODO: Unblock this test, see: https://github.com/apache/polaris/issues/1273 */ @Override @Test - @Disabled( - """ - Disabled because the behavior is not applicable to Polaris. - To unblock, update this to expect an exception and add a Polaris-specific test. - """) public void createViewWithCustomMetadataLocation() { - super.createViewWithCustomMetadataLocation(); + Assertions.assertThatThrownBy(super::createViewWithCustomMetadataLocation) + .isInstanceOf(ForbiddenException.class) + .hasMessageContaining("Forbidden: Invalid locations"); + } + + @Test + public void createViewWithCustomMetadataLocationUsingPolaris(@TempDir Path tempDir) { + TableIdentifier identifier = TableIdentifier.of("ns", "view"); + + String location = Paths.get(tempDir.toUri().toString()).toString(); + String customLocation = Paths.get(tempDir.toUri().toString(), "custom-location").toString(); + String customLocation2 = Paths.get(tempDir.toUri().toString(), "custom-location2").toString(); + String customLocationChild = + Paths.get(tempDir.toUri().toString(), "custom-location/child").toString(); + + if (requiresNamespaceCreate()) { Review Comment: Is this not always `true` in Polaris? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@polaris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org