我正在尝试在 Maven 中使用 Arquillian 测试 JakartaEE 应用程序。由于生产应用程序应该在 Payara Micro 上运行,因此我选择了 Payara Micro Remote 依赖项来与远程服务器进行通信:
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<version>1.6.0.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>fish.payara.arquillian</groupId>
<artifactId>payara-micro-remote</artifactId>
<version>2.2</version>
<scope>test</scope>
/dependency>
</dependencies>
当我执行测试时,出现以下错误:
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.325 s <<< FAILURE! - in com.mycompany.SomeTestClass
[ERROR] com.mycompany.SomeTestClass Time elapsed: 1.325 s <<< ERROR!
java.lang.IllegalArgumentException: Deployment failed. Payara Micro Deployer at http://localhost:8080/micro-deployer returned 404
我还尝试将 Payara Micro Deployer 部署到远程 Payara Micro Server,如下所示:
<plugin>
<groupId>fish.payara.maven.plugins</groupId>
<artifactId>payara-micro-maven-plugin</artifactId>
<version>1.0.7</version>
<configuration>
<daemon>true</daemon>
<commandLineOptions>
<commandLineOption>
<key>--deployFromGAV</key>
<value>"fish.payara.arquillian,payara-micro-deployer,2.2"</value>
</commandLineOption>
</commandLineOptions>
</configuration>
<!-- ...some cother settings... -->
</plugin>
但这导致
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.34 s <<< FAILURE! - in com.mycompany.SomeTestClass
[ERROR] com.mycompany.SomeTestClass Time elapsed: 1.34 s <<< ERROR!
java.lang.IllegalArgumentException: Deployment failed. Payara Micro Deployer at http://localhost:8080/micro-deployer returned 403
我究竟做错了什么?是否有任何关于如何使用 Payara Micro Remote 使 Arquillian 工作的描述或示例项目?
我使用的 Payara Micro 版本是 5.194。
先感谢您!