启用Websphere安全性后,Arquillian测试将停止工作

时间:2015-05-14 15:02:10

标签: java websphere integration-testing jboss-arquillian

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");
}

1 个答案:

答案 0 :(得分: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>