I would like to use the Arquillian Restclient extension to run tests on the restinterface.
When deploying the whole EAR, everything works find, but i would like to have a test-war that only contains the REST Interface
The deploymentURL contains the name of the generated WAR file
e.g. /59ba22be-9b4b-499d-8094-8f626bc4ebd7/
this causes the test to fail, because i would like to define an "external" URL that is always the same http://www.world.com/testproject
@RunWith(Arquillian.class)
public class RestClientTestCase {
@ArquillianResource
private URL deploymentURL;
@Deployment
public static Archive<?> createDeployment() {
File[] files = Maven.resolver()
.loadPomFromFile("pom.xml")
.importRuntimeDependencies()
.resolve()
.withTransitivity()
.asFile();
// Create deploy file
WebArchive war = ShrinkWrap.create(WebArchive.class)
.addClass(SimpleService.class)
.addClass(Resources.class)
.addClass(APIExceptionInterceptor.class)
.addClass(ApplicationConfig.class)
.addAsLibraries(files)
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
return war;
}
@Test
@RunAsClient
public void saysomething(@ArquillianResteasyResource SimpleService simpleService)
{
final String name = "echo >>>:world";
final String result = simpleService.saysomething("world");
assertNotNull(result);
assertEquals(name, result);
}
}
Does anybody has an idea how to run the Arrquillian Rest Tests against an external (=non-local) target?
Do I have to configure a targetadress inside the arquillian.xml?
Kind regards
Malcom