You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2021/08/15 02:38:24 UTC

[shardingsphere] branch master updated: Use @RunWith(MockitoJUnitRunner.class) to instead of MockitoAnnotations.initMocks(this); (#11825)

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

panjuan 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 b704ebc  Use @RunWith(MockitoJUnitRunner.class) to instead of MockitoAnnotations.initMocks(this); (#11825)
b704ebc is described below

commit b704ebc1c88e756d4537509ab504313a49203445
Author: Liang Zhang <te...@163.com>
AuthorDate: Sun Aug 15 10:38:00 2021 +0800

    Use @RunWith(MockitoJUnitRunner.class) to instead of MockitoAnnotations.initMocks(this); (#11825)
---
 .../process/subscriber/ProcessRegistrySubscriberTest.java      | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/shardingsphere-governance/shardingsphere-governance-core/src/test/java/org/apache/shardingsphere/governance/core/registry/process/subscriber/ProcessRegistrySubscriberTest.java b/shardingsphere-governance/shardingsphere-governance-core/src/test/java/org/apache/shardingsphere/governance/core/registry/process/subscriber/ProcessRegistrySubscriberTest.java
index 271d88c..3ccccaa 100644
--- a/shardingsphere-governance/shardingsphere-governance-core/src/test/java/org/apache/shardingsphere/governance/core/registry/process/subscriber/ProcessRegistrySubscriberTest.java
+++ b/shardingsphere-governance/shardingsphere-governance-core/src/test/java/org/apache/shardingsphere/governance/core/registry/process/subscriber/ProcessRegistrySubscriberTest.java
@@ -30,11 +30,11 @@ import org.apache.shardingsphere.infra.executor.sql.process.model.ExecuteProcess
 import org.apache.shardingsphere.infra.executor.sql.process.model.yaml.YamlExecuteProcessContext;
 import org.apache.shardingsphere.infra.executor.sql.process.model.yaml.YamlExecuteProcessUnit;
 import org.apache.shardingsphere.infra.yaml.engine.YamlEngine;
-import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
+import org.mockito.junit.MockitoJUnitRunner;
 
 import java.util.Collection;
 import java.util.Collections;
@@ -46,6 +46,7 @@ import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+@RunWith(MockitoJUnitRunner.class)
 public final class ProcessRegistrySubscriberTest {
     
     @Mock
@@ -54,11 +55,6 @@ public final class ProcessRegistrySubscriberTest {
     @InjectMocks
     private ProcessRegistrySubscriber processRegistrySubscriber;
     
-    @Before
-    public void init() {
-        MockitoAnnotations.initMocks(this);
-    }
-    
     @Test
     public void assertLoadShowProcessListData() {
         ShowProcessListRequestEvent showProcessListRequestEvent = mock(ShowProcessListRequestEvent.class);