使用@Test测试spring报错

使用@Test测试时,须要告诉junit spring的配置文件
在这里插入图片描述不然在注入时,会发生空指针异常,缘由是junit根本找不到ioc容器,从而没法进行注入web