1.导

(1)junit

(2)spring-junit

2.创建测试类

(1)使用指定类运行器(红框)

(2)指定Spring配置类(蓝框,注意格式!)

        

(3)写测试方法(@Test),进行测试