whitelowrie edited a comment on issue #4175:
URL: 
https://github.com/apache/incubator-dolphinscheduler/issues/4175#issuecomment-740350496


   Please use english!!!
   and you can write the test like this before you configured correctly
   
   ```java
   @RunWith(SpringJUnit4ClassRunner.class)
   @ContextConfiguration(classes={DependencyConfig.class, 
SpringApplicationContext.class, SpringZKServer.class,
           NettyExecutorManager.class, ExecutorDispatcher.class, 
ZookeeperRegistryCenter.class, TaskPriorityQueueConsumer.class,
           ZookeeperNodeManager.class, ZookeeperCachedOperator.class, 
ZookeeperConfig.class, MasterConfig.class})
   public class MyTest {
   
       @Autowired
       private ProcessService processService = null;
   
       @Test
       public void test01(){
           System.out.println(processService);
       }
   }
   ```
   
   if you use the recommended mock test, you can write the test like this
   ```java
   @RunWith(MockitoJUnitRunner.Silent.class)
   public class MyTestMock {
       @Autowired
       private ProcessService processService = null;
       @Before
       public void init(){
           processService = mock(ProcessService.class);
       }
       @Test
       public void test01(){
           System.out.println(">>>>>>>>>>>>>" + processService.getUserById(1));
       }
   }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to