我有 JUnit 测试(有些人称其为“集成测试”)来测试 REST 服务以进行文件上传/下载。我正在使用来自标准 Websphere 8.5 库的 Apache WINK:
ClientConfig config = new ClientConfig();
LtpaAuthSecurityHandler secHandler = new LtpaAuthSecurityHandler();
secHandler.setUserName(user);
secHandler.setPassword(password);
secHandler.setSSLRequired(false);
config.handlers(secHandler);
RestClient client = new RestClient(config);
但我得到了例外:
java.lang.ClassNotFoundException: com.ibm.ejs.ras.hpel.HpelHelper
我正在使用以下测试依赖项:
<dependency>
<groupId>com.ibm.was</groupId>
<artifactId>com.ibm.ws.jpa.thinclient</artifactId>
<version>8.5.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
我在这里缺少什么?测试代码在 WebSphere 上部署时工作正常,但不能作为使用瘦客户端的独立 junit 测试(或主函数)工作。