运行 SqlExecutorTest 测试类的时候报错,应该是没有拉起spring 服务,请问是缺少了什么注解吗?

This UT is marked with @Ignore. If you are interested, you can refactor it. It is recommended to use the mock form and only test the SqlExecutor method.
Please use english!!!
and you can write the test like this before you configured correctly
@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);
}
}
recommended the mock , you can write the test like this
@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));
}
}
Please use english!!!
and you can write the test like this before you configured correctly@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); } }
We hope to adopt the mock form, because ut should remain relatively independent. Are you interested in refactoring this UT?
OK, thanks
@CalvinKirs
Sure,I can do this.
Most helpful comment
Please use english!!!
and you can write the test like this before you configured correctly
recommended the mock , you can write the test like this