1

我有 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 测试(或主函数)工作。

4

2 回答 2

3

我遇到了同样的错误。为了修复它,我添加了这些依赖项:

<classpathentry kind="lib" path="lib/com.ibm.jaxws.thinclient_8.5.0.jar"/>
<classpathentry kind="lib" path="lib/com.ibm.ws.admin.client_8.5.0.jar"/>
<classpathentry kind="lib" path="lib/com.ibm.ws.webservices.thinclient_8.5.0.jar"/>
于 2017-02-23T13:21:39.113 回答
0

我遇到了同样的异常,在我添加以下内容后它得到了解决。

  <dependency>
     <groupId>com.ibm.jaxws</groupId>
     <artifactId>thinclient</artifactId>
     <version>8.0.0</version>
     <scope>provided</scope>
  </dependency>
于 2016-08-01T21:36:58.427 回答