From 41d021a5d4a84f4bac52e9cea245293dc179ce09 Mon Sep 17 00:00:00 2001 From: Giorgio Trettenero Date: Fri, 6 Dec 2024 23:02:29 -0800 Subject: [PATCH] check if table exist and db exists after db delete was blocked --- .../polaris/PolarisConnectorDatabaseServiceTest.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/metacat-connector-polaris/src/test/java/com/netflix/metacat/connector/polaris/PolarisConnectorDatabaseServiceTest.java b/metacat-connector-polaris/src/test/java/com/netflix/metacat/connector/polaris/PolarisConnectorDatabaseServiceTest.java index 96f66fe6..b988fcc0 100644 --- a/metacat-connector-polaris/src/test/java/com/netflix/metacat/connector/polaris/PolarisConnectorDatabaseServiceTest.java +++ b/metacat-connector-polaris/src/test/java/com/netflix/metacat/connector/polaris/PolarisConnectorDatabaseServiceTest.java @@ -7,6 +7,7 @@ import com.netflix.metacat.common.server.connectors.ConnectorRequestContext; import com.netflix.metacat.common.server.connectors.exception.DatabaseAlreadyExistsException; import com.netflix.metacat.common.server.connectors.exception.DatabaseNotFoundException; +import com.netflix.metacat.common.server.connectors.exception.InvalidMetaException; import com.netflix.metacat.common.server.connectors.model.AuditInfo; import com.netflix.metacat.common.server.connectors.model.DatabaseInfo; import com.netflix.metacat.common.server.connectors.model.TableInfo; @@ -218,10 +219,11 @@ public void testDeleteDbNoCascades() { polarisDBService.delete(requestContext, DB1_QUALIFIED_NAME); -// Assertions.assertThrows(InvalidMetaException.class, () -> -// polarisDBService.delete(requestContext, DB1_QUALIFIED_NAME)); + Assertions.assertThrows(InvalidMetaException.class, () -> + polarisDBService.delete(requestContext, DB1_QUALIFIED_NAME)); + Assert.assertTrue(polarisTableService.exists(requestContext, qualifiedName)); - Assert.assertFalse(polarisDBService.exists(requestContext, DB1_QUALIFIED_NAME)); + Assert.assertTrue(polarisDBService.exists(requestContext, DB1_QUALIFIED_NAME)); } }