0 Replies Latest reply on Dec 5, 2017 9:25 AM by charis moutafidis

    @ArquillianResource URL returns null

    charis moutafidis Newbie

      Hello there,

       

      I am using arquillian to create a deployment. In my test case I want to send POST requests to the container. Here is my Test Class:

       

      @RunWith(Arquillian.class)

      public class ServiceTest{

         

          @ArquillianResource

          private URL serverUrl;

         

          @ArquillianResource(Service.class)

          private URL baseServerURL;

         

          @Deployment

          public static WebArchive createDeployment() {

              WebArchive w = ShrinkWrap.create(WebArchive.class, "test.war")

                  .addClasses(Resource.class, Service.class)

                  .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")

                      ;

              System.out.println(w.toString(true));

              return w;

          }

       

       

          @Test

          @RunAsClient

          public void testCase(@ArquillianResource URL baseURL){

              System.out.println(baseURL);

              System.out.println(serverUrl);

              System.out.println(baseServerURL + "\n");

             

              Assert.assertTrue(true);

          }

      }

       

       

      And my output is:

      NULL
      NULL
      NULL
      Anyone has a clue?