4.4. 测试部署到 OpenShift Container Platform 上的 JBoss EAP 的应用程序
测试部署到 OpenShift Container Platform 上的 JBoss EAP 的应用程序。
先决条件
您已创建了测试类。
如需更多信息,请参阅创建测试类来测试应用程序
流程
- 将更改推送到您的 Git 存储库。
- 进入 < application_home> 目录。
使用
verify命令运行测试,激活integration-testing配置集并指定应用程序的 URL。mvn verify -Pintegration-testing -Dserver.host=https://$(oc get route helloworld --template='{{ .spec.host }}')$ mvn verify -Pintegration-testing -Dserver.host=https://$(oc get route helloworld --template='{{ .spec.host }}')Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注意测试使用 SSL/TLS 连接到部署的应用程序。因此,您需要运行测试的机器信任证书。
要信任证书,您必须将其添加到 Java 信任存储中。
Example
keytool -trustcacerts -keystore _<path-to-java-truststore>_ -storepass _<trust-store-password>_ -importcert -alias _<alias-for-the-certificate>_ -file _<path-to-certificate>_/_<certificate-name>_
$ keytool -trustcacerts -keystore _<path-to-java-truststore>_ -storepass _<trust-store-password>_ -importcert -alias _<alias-for-the-certificate>_ -file _<path-to-certificate>_/_<certificate-name>_Copy to Clipboard Copied! Toggle word wrap Toggle overflow 输出示例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
更新于 2024-02-08