/**
 * Copyright (c) 2013-2016, The SeedStack authors <http://seedstack.org>
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
package org.seedstack.netflix.feign;

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Before;
import org.junit.Test;
import org.seedstack.netflix.feign.fixtures.Message;
import org.seedstack.netflix.feign.fixtures.TestAPI;
import org.seedstack.netflix.feign.fixtures.TestResource;
import org.seedstack.netflix.feign.internal.FeignConfig;
import org.seedstack.seed.Configuration;
import org.seedstack.seed.it.AbstractSeedWebIT;

import javax.inject.Inject;

import java.net.URL;

import static org.assertj.core.api.Assertions.assertThat;

public class FeignIT extends AbstractSeedWebIT {

    @ArquillianResource
    private URL baseUrl;

    @Inject
    private TestAPI testAPI;

    @Deployment(testable = false)
    public static WebArchive createDeployment() {
        return ShrinkWrap.create(WebArchive.class, "test.war").addPackage(TestResource.class.getPackage());
    }

    @Test
    public void test_API() {
        assertThat(testAPI).isNotNull();
        Message message = testAPI.getMessage();
        assertThat(message.getBody()).isEqualTo("Hello World !");
        assertThat(message.getAuthor()).isEqualTo("computer");
    }

    @Test
    public void test_fallback() {
        Message message = testAPI.get404();
        assertThat(message.getBody()).isEqualTo("Error code: 404 !");
        assertThat(message.getAuthor()).isEqualTo("fallback");
    }
}

@@ -317,16 +317,73 @@
 feign;%0A%0A
+import feign.Feign;%0Aimport feign.jackson.JacksonDecoder;%0A
 import o
@@ -433,16 +433,16 @@
 oyment;%0A
-
 import o
@@ -587,33 +587,8 @@
 ve;%0A
-import org.junit.Before;%0A
 impo
@@ -823,55 +823,11 @@
 eign
-Config;%0Aimport org.seedstack.seed.Configuration
+Api
 ;%0Aim
@@ -901,17 +901,16 @@
 Inject;%0A
-%0A
 import j
@@ -1374,38 +1374,208 @@
     
-assertThat(testAPI).isNotNull(
+// Cannot use injected api because Arquillian server starts on a random url each time%0A        TestAPI api = Feign.builder().decoder(new JacksonDecoder()).target(TestAPI.class, baseUrl.toExternalForm()
 );%0A 
@@ -1595,31 +1595,27 @@
 e message = 
-testAPI
+api
 .getMessage(
@@ -1755,32 +1755,32 @@
    %7D%0A%0A    @Test%0A
-
     public void 
@@ -1793,24 +1793,65 @@
 allback() %7B%0A
+        assertThat(testAPI).isNotNull();%0A
         Mess

Fix tests on Arquillian