Skip to content

Commit 9a9a670

Browse files
committed
Refactor usage of ContextManagerLifecycleListener.onInitialized
1 parent c037876 commit 9a9a670

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/schedule/core/src/test/java/org/apache/shardingsphere/schedule/core/job/statistics/collect/StatisticsCollectContextManagerLifecycleListenerTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void assertOnInitializedWithNotProxy() {
3535
ContextManager contextManager = mock(ContextManager.class, RETURNS_DEEP_STUBS);
3636
when(contextManager.getComputeNodeInstanceContext().getModeConfiguration().isCluster()).thenReturn(true);
3737
new StatisticsCollectContextManagerLifecycleListener().onInitialized(contextManager);
38-
verify(contextManager.getComputeNodeInstanceContext(), times(2)).getModeConfiguration();
38+
verify(contextManager.getComputeNodeInstanceContext()).getModeConfiguration();
3939
}
4040

4141
@Test
@@ -44,7 +44,7 @@ void assertOnInitializedWithProxy() {
4444
when(contextManager.getComputeNodeInstanceContext().getModeConfiguration().isCluster()).thenReturn(true);
4545
when(contextManager.getComputeNodeInstanceContext().getInstance().getMetaData().getType()).thenReturn(InstanceType.PROXY);
4646
new StatisticsCollectContextManagerLifecycleListener().onInitialized(contextManager);
47-
verify(contextManager.getComputeNodeInstanceContext(), times(3)).getModeConfiguration();
47+
verify(contextManager.getComputeNodeInstanceContext(), times(2)).getModeConfiguration();
4848
}
4949

5050
@Test

0 commit comments

Comments
 (0)