想使用单元测试 来测一下服务请求,于是想到了使用Junit,查了一下,决定使用 HttpUnit 来发送请求
于是在maven中引入了
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>httpunit</groupId>
<artifactId>httpunit</artifactId>
<version>1.7</version>
</dependency>
运行程序的时候,报 Rhino classes (js.jar) not found - Javascript disabled
原因是还少引入了一个jar包
<dependency>
<groupId>rhino</groupId>
<artifactId>js</artifactId>
<version>1.7R2</version>
</dependency>
如果缺少jar包,需要查找 maven 如何写的时候,可以查询 http://mvnrepository.com