Skip to content

Commit

Permalink
Refactor GlobalRuleChangedHandlerTest (#34544)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Jan 31, 2025
1 parent 4009ccc commit 2e269b0
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import java.util.Optional;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
Expand All @@ -54,13 +55,13 @@ void setUp() {
@Test
void assertHandleWithInvalidEventKey() {
handler.handle(contextManager, new DataChangedEvent("/rules/foo_rule/xxx", "rule_value", Type.ADDED));
verify(contextManager, times(0)).getPersistServiceFacade();
verify(contextManager.getPersistServiceFacade().getMetaDataPersistFacade().getGlobalRuleService(), times(0)).load(any());
}

@Test
void assertHandleWithEmptyRuleName() {
handler.handle(contextManager, new DataChangedEvent("/rules/foo_rule/active_version/foo", "rule_value", Type.ADDED));
verify(contextManager, times(0)).getPersistServiceFacade();
verify(contextManager.getPersistServiceFacade().getMetaDataPersistFacade().getGlobalRuleService(), times(0)).load(any());
}

@Test
Expand Down

0 comments on commit 2e269b0

Please sign in to comment.