Skip to content

Commit

Permalink
RESTEASY-2678 - Fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
radcortez authored and asoldano committed Sep 18, 2020
1 parent 00df849 commit a90b583
Showing 1 changed file with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@

@RunWith(Arquillian.class)
@RunAsClient
public class RestClientProviderPriority
public class RestClientProviderPriorityTest
{
@ArquillianResource
URL url;

@Deployment
public static Archive<?> deploy()
{
WebArchive war = TestUtil.prepareArchive(RestClientProviderPriority.class.getSimpleName());
WebArchive war = TestUtil.prepareArchive(RestClientProviderPriorityTest.class.getSimpleName());
war.addClass(HelloResource.class);
war.addClass(HelloClient.class);
war.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
Expand All @@ -49,15 +49,7 @@ public static Archive<?> deploy()

private String generateURL(String path)
{
return PortProviderUtil.generateURL(path, RestClientProviderPriority.class.getSimpleName());
}

@Test
public void helloUndefined() throws Exception {
HelloClient helloClient =
RestClientBuilder.newBuilder().baseUrl(new URL(generateURL(""))).build(HelloClient.class);

assertEquals("Hello undefined", helloClient.hello(null));
return PortProviderUtil.generateURL(path, RestClientProviderPriorityTest.class.getSimpleName());
}

@Test
Expand Down Expand Up @@ -91,14 +83,11 @@ public static class HelloResource {
@GET
@Path("/hello")
public String hello(@QueryParam("who") String who) {
if (who == null || who.isEmpty()) {
who = "undefined";
}

return "Hello " + who;
}
}

// RESTEASY-2678 - the @Priority annotation was ignored, so the priority would be -1 and this would execute first.
@Priority(value = Integer.MAX_VALUE)
public static class HelloFooProvider implements ClientRequestFilter {
@Override
Expand Down

0 comments on commit a90b583

Please sign in to comment.