Search in sources :

Example 6 with WebXmlAsset

use of org.wildfly.swarm.undertow.descriptors.WebXmlAsset in project wildfly-swarm by wildfly-swarm.

the class WebXmlAssetTest method testSingleContextParamValue.

@Test
public void testSingleContextParamValue() throws Exception {
    WebXmlAsset asset = new WebXmlAsset();
    assertThat(asset.getContextParam("my-param")).isNull();
    asset.setContextParam("my-param", "myValue");
    String paramValue = asset.getContextParam("my-param");
    assertThat(paramValue).isNotNull();
    assertThat(paramValue).isNotEmpty();
    assertThat(paramValue).isEqualTo("myValue");
}
Also used : WebXmlAsset(org.wildfly.swarm.undertow.descriptors.WebXmlAsset) Test(org.junit.Test)

Example 7 with WebXmlAsset

use of org.wildfly.swarm.undertow.descriptors.WebXmlAsset in project wildfly-swarm by wildfly-swarm.

the class WebXmlAssetTest method testMultipleContextParamValue.

@Test
public void testMultipleContextParamValue() throws Exception {
    WebXmlAsset asset = new WebXmlAsset();
    assertThat(asset.getContextParam("my-param")).isNull();
    asset.setContextParam("my-param", "myValue1", "myValue2", "myValue3");
    String paramValue = asset.getContextParam("my-param");
    assertThat(paramValue).isNotNull();
    assertThat(paramValue).isNotEmpty();
    assertThat(paramValue).isEqualTo("myValue1,myValue2,myValue3");
}
Also used : WebXmlAsset(org.wildfly.swarm.undertow.descriptors.WebXmlAsset) Test(org.junit.Test)

Example 8 with WebXmlAsset

use of org.wildfly.swarm.undertow.descriptors.WebXmlAsset in project wildfly-swarm by wildfly-swarm.

the class WebXmlAssetTest method testFormLoginConfig.

@Test
public void testFormLoginConfig() throws Exception {
    WebXmlAsset asset = new WebXmlAsset();
    asset.setFormLoginConfig("myRealm", "/login", "/error");
    assertThat(asset.getLoginRealm("FORM")).isEqualTo("myRealm");
}
Also used : WebXmlAsset(org.wildfly.swarm.undertow.descriptors.WebXmlAsset) Test(org.junit.Test)

Example 9 with WebXmlAsset

use of org.wildfly.swarm.undertow.descriptors.WebXmlAsset in project wildfly-swarm by wildfly-swarm.

the class WebXmlAssetTest method testInvalidContextParamName.

@Test
public void testInvalidContextParamName() throws Exception {
    WebXmlAsset asset = new WebXmlAsset();
    assertThat(asset.getContextParam(null)).isNull();
    assertThat(asset.getContextParam("")).isNull();
    assertThat(asset.getContextParam("   ")).isNull();
}
Also used : WebXmlAsset(org.wildfly.swarm.undertow.descriptors.WebXmlAsset) Test(org.junit.Test)

Example 10 with WebXmlAsset

use of org.wildfly.swarm.undertow.descriptors.WebXmlAsset in project wildfly-swarm by wildfly-swarm.

the class WebXmlAssetTest method testUnsetLoginAuthMethod.

@Test
public void testUnsetLoginAuthMethod() throws Exception {
    WebXmlAsset asset = new WebXmlAsset();
    assertThat(asset.getLoginRealm("keycloak")).isNull();
}
Also used : WebXmlAsset(org.wildfly.swarm.undertow.descriptors.WebXmlAsset) Test(org.junit.Test)

Aggregations

WebXmlAsset (org.wildfly.swarm.undertow.descriptors.WebXmlAsset)14 Test (org.junit.Test)9 WARArchive (org.wildfly.swarm.undertow.WARArchive)5 JBossWebAsset (org.wildfly.swarm.undertow.descriptors.JBossWebAsset)2 SecurityConstraint (org.wildfly.swarm.undertow.descriptors.SecurityConstraint)2 BufferedReader (java.io.BufferedReader)1 InputStreamReader (java.io.InputStreamReader)1 Collections (java.util.Collections)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Inject (javax.inject.Inject)1 AnnotationInstance (org.jboss.jandex.AnnotationInstance)1 AnnotationValue (org.jboss.jandex.AnnotationValue)1 ClassInfo (org.jboss.jandex.ClassInfo)1 MethodInfo (org.jboss.jandex.MethodInfo)1 Logger (org.jboss.logging.Logger)1 Archive (org.jboss.shrinkwrap.api.Archive)1 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)1 AttributeDocumentation (org.wildfly.swarm.config.runtime.AttributeDocumentation)1