-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Make RESTEasy Reactive path matching more spec compliant
- Loading branch information
Showing
3 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...src/test/java/org/jboss/resteasy/reactive/server/vertx/test/matching/EndingSlashTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package org.jboss.resteasy.reactive.server.vertx.test.matching; | ||
|
||
import static io.restassured.RestAssured.*; | ||
import static org.hamcrest.Matchers.equalTo; | ||
|
||
import java.util.function.Supplier; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
import org.jboss.resteasy.reactive.server.vertx.test.framework.ResteasyReactiveUnitTest; | ||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
public class EndingSlashTest { | ||
|
||
@RegisterExtension | ||
static ResteasyReactiveUnitTest test = new ResteasyReactiveUnitTest() | ||
.setArchiveProducer(new Supplier<>() { | ||
@Override | ||
public JavaArchive get() { | ||
return ShrinkWrap.create(JavaArchive.class) | ||
.addClasses(TestResource.class); | ||
} | ||
}); | ||
|
||
@Test | ||
public void test() { | ||
get("/hello/world") | ||
.then() | ||
.statusCode(200) | ||
.body(equalTo("Hello World!")); | ||
|
||
get("/hello/world/") | ||
.then() | ||
.statusCode(200) | ||
.body(equalTo("Hello World!")); | ||
} | ||
|
||
@Path("/hello") | ||
public static class TestResource { | ||
|
||
@GET | ||
@Path("/world/") | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public String test() { | ||
return "Hello World!"; | ||
} | ||
} | ||
} |