启用Websphere安全性后,Arquillian测试停止工作 [英] Arquillian tests stop working after enabling Websphere security

查看:131
本文介绍了启用Websphere安全性后,Arquillian测试停止工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我在Websphere管理控制台中启用安全性之前(为了构建登录功能),Arquillian IT测试运行良好.因此,问题是如何在启用Websphere安全性的情况下运行测试.其LDAP(Microsoft AD). 谢谢

Arquillian IT tests run fine till the moment I enabled the security in Websphere admin console (In order to build the login functionality). So the question is how to run Tests with Websphere security anabled. Its LDAP (Microsoft AD). Thanks

Arquillian.xml

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配置,如下所示:

For secured server you need to add username/password and ssl config like this:

<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>

这篇关于启用Websphere安全性后,Arquillian测试停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆