Skip to content

Commit

Permalink
Use DataChangedEventHandler to instead of DispatchEventBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Dec 31, 2024
1 parent 074e5f5 commit 5fc4a7c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.mode.manager.cluster.event.dispatch.listener.type.DatabaseMetaDataChangedListener;
import org.apache.shardingsphere.mode.manager.cluster.event.dispatch.listener.type.GlobalMetaDataChangedListener;
import org.apache.shardingsphere.mode.manager.cluster.event.dispatch.listener.type.GlobalMetaDataChangedHandler;
import org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
import org.junit.jupiter.api.Test;

Expand All @@ -44,6 +44,6 @@ void assertRegister() {
DataChangedEventListenerRegistry registry = new DataChangedEventListenerRegistry(contextManager, Collections.singleton("foo_db"));
registry.register();
verify(repository).watch(eq("/metadata/foo_db"), any(DatabaseMetaDataChangedListener.class));
verify(repository, atLeastOnce()).watch(anyString(), any(GlobalMetaDataChangedListener.class));
verify(repository, atLeastOnce()).watch(anyString(), any(GlobalMetaDataChangedHandler.class));
}
}

0 comments on commit 5fc4a7c

Please sign in to comment.