@@ -0,0 +1,2048 @@
+/**%0A * Copyright (C) 2016 McFoggy %5Bhttps://github.com/McFoggy/xhub4j%5D (matthieu@brouillard.fr)%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *         http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage fr.brouillard.oss.security.xhub.servlet;%0A%0Aimport static org.hamcrest.CoreMatchers.is;%0Aimport static org.hamcrest.CoreMatchers.startsWith;%0Aimport static org.junit.Assert.assertNotNull;%0Aimport static org.junit.Assert.assertThat;%0A%0Aimport java.net.URL;%0A%0Aimport org.jboss.arquillian.container.test.api.Deployment;%0Aimport org.jboss.arquillian.junit.Arquillian;%0Aimport org.jboss.arquillian.test.api.ArquillianResource;%0Aimport org.jboss.shrinkwrap.api.ShrinkWrap;%0Aimport org.jboss.shrinkwrap.api.asset.EmptyAsset;%0Aimport org.jboss.shrinkwrap.api.spec.WebArchive;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0A%0A@RunWith(Arquillian.class)%0Apublic class ArquillianURLInjectionIT %7B%0A    @Deployment(testable = false)%0A    public static WebArchive createDeployment() %7B%0A        WebArchive war = ShrinkWrap.create(WebArchive.class).addAsResource(EmptyAsset.INSTANCE, %22META-INF/beans.xml%22);%0A        return war;%0A    %7D%0A    %0A    @ArquillianResource URL deploymentURLAsClassAttribute;%0A    %0A    @Test%0A    public void tested_url_can_be_injected_in_several_ways(@ArquillianResource URL deploymentURLAsParameter) %7B%0A        assertNotNull(deploymentURLAsClassAttribute);%0A        assertNotNull(deploymentURLAsParameter);%0A        %0A        assertThat(deploymentURLAsParameter, is(deploymentURLAsClassAttribute));%0A        assertThat(deploymentURLAsParameter.toString(), startsWith(%22http://%22));%0A    %7D%0A%7D%0A

add an IT test to demo test URL injection