的Arquillian测试停止允许WebSphere安全性后工作(Arquillian tests

2019-10-23 02:36发布

IT的Arquillian测试运行正常,直到此刻我启用了WebSphere管理控制台安全(为了构建登录功能)。 所以,问题是如何运行与WebSphere安全测试anabled。 它的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");
}

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


文章来源: Arquillian tests stop working after enabling Websphere security