【问题标题】:Arquillian tests stop working after enabling Websphere security启用 Websphere 安全性后,Arquillian 测试停止工作
【发布时间】:2015-05-14 15:02:10
【问题描述】:

Arquillian IT 测试运行良好,直到我在 Websphere 管理控制台中启用安全性(为了构建登录功能)。所以问题是如何在启用 Websphere 安全性的情况下运行测试。它的 LDAP (Microsoft 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");
}

【问题讨论】:

    标签: java websphere integration-testing jboss-arquillian


    【解决方案1】:

    对于安全服务器,您需要像这样添加用户名/密码和 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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-11-22
      • 2017-06-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-29
      • 2015-01-15
      • 2016-10-15
      相关资源
      最近更新 更多