gpt4 book ai didi

java - 启用 Websphere 安全性后 Arquillian 测试停止工作

转载 作者:行者123 更新时间:2023-11-30 08:12:08 24 4
gpt4 key购买 nike

Arquillian IT 测试运行良好,直到我在 Websphere 管理控制台中启用安全性(为了构建登录功能)。所以问题是如何在启用 Websphere 安全性的情况下运行测试。它的LDAP(微软AD)。谢谢

Arquillian.xml

……

<container qualifier="websphere" default="true">
<configuration>
<property name="remoteServerAddress">localhost</property>
<property name="remoteServerSoapPort">8880</property>
<property name="securityEnabled">true</property>
</configuration>
</container>

……

测试示例

@RunWith(Arquillian.class)
public class GreeterIT {

@Inject
private Greeter greeter;

@Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap.create(JavaArchive.class, "Arquillian-GreeterIT.jar")
.addClass(Greeter.class)
.addClass(SubGreeter.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
}

@Test
public void createGreetingTest() {
Assert.assertEquals("Hello, Earthling!",
greeter.createGreeting("Earthling"));
greeter.greet(System.out, "Earthling");
}

最佳答案

对于安全服务器,您需要添加用户名/密码和 ssl 配置,如下所示:

<container qualifier="websphere_IntegrationTest" default="true">
<configuration>
<property name="remoteServerAddress">localhost</property>
<property name="remoteServerSoapPort">8880</property>
<property name="securityEnabled">true</property>
<property name="username">admin</property>
<property name="password">admin</property>
<property name="sslTrustStore">PATH_TO\DummyClientTrustFile.jks</property>
<property name="sslTrustStorePassword">WebAS</property>
</configuration>
</container>

关于java - 启用 Websphere 安全性后 Arquillian 测试停止工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30240653/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com