在使用spring註解單元測試開發的時候
<!--結合junit可以進行單元測試,詳見博客收藏 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>4.0.9.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>4.0.9.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>4.0.9.RELEASE</version> </dependency>
版本 一定要一致,另外。紅圈處一定要同時出現。