介绍在 spring 的框架下,做单元 测试 的两种办法。 一、使用spring中对Junit框架的整合功能 除了junit4和spring的jar包,还需要spring-test.jar。引入如下依赖: <dependency> <groupId>junit</groupId>