This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new d12ad36543d Fix StandaloneMetaDataManagerPersistServiceTest (#34459)
d12ad36543d is described below

commit d12ad36543d34b7a30a1cce676e1a696bfb7cd0a
Author: Liang Zhang <[email protected]>
AuthorDate: Fri Jan 24 11:39:53 2025 +0800

    Fix StandaloneMetaDataManagerPersistServiceTest (#34459)
---
 .../persist/service/StandaloneMetaDataManagerPersistServiceTest.java   | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/persist/service/StandaloneMetaDataManagerPersistServiceTest.java
 
b/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/persist/service/StandaloneMetaDataManagerPersistServiceTest.java
index 747493e80be..b406597c808 100644
--- 
a/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/persist/service/StandaloneMetaDataManagerPersistServiceTest.java
+++ 
b/mode/type/standalone/core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/persist/service/StandaloneMetaDataManagerPersistServiceTest.java
@@ -36,7 +36,6 @@ import 
org.apache.shardingsphere.mode.spi.rule.item.alter.AlterRuleItem;
 import org.apache.shardingsphere.mode.spi.rule.item.drop.DropRuleItem;
 import org.apache.shardingsphere.single.config.SingleRuleConfiguration;
 import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockito.Answers;
@@ -131,11 +130,11 @@ class StandaloneMetaDataManagerPersistServiceTest {
         verify(databaseMetaDataFacade.getSchema()).drop("foo_db", 
"foo_schema");
     }
     
-    @Disabled("fix this unit test by haorang")
     @Test
     void assertDropSchema() {
         ShardingSphereDatabase database = mock(ShardingSphereDatabase.class, 
RETURNS_DEEP_STUBS);
         when(database.getName()).thenReturn("foo_db");
+        when(database.getSchema("foo_schema")).thenReturn(new 
ShardingSphereSchema("foo_schema"));
         ShardingSphereMetaData metaData = new 
ShardingSphereMetaData(Collections.singleton(database), mock(), mock(), new 
ConfigurationProperties(new Properties()));
         
when(metaDataContextManager.getMetaDataContexts().getMetaData()).thenReturn(metaData);
         metaDataManagerPersistService.dropSchema("foo_db", 
Collections.singleton("foo_schema"));

Reply via email to