-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure suspend methods in RESTEasy Reactive use the same default medi…
…a types Fixes: #18145
- Loading branch information
Showing
7 changed files
with
52 additions
and
3 deletions.
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
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
13 changes: 13 additions & 0 deletions
13
...otlin/standard/src/main/kotlin/io/quarkus/it/resteasy/reactive/kotlin/GreetingResource.kt
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,13 @@ | ||
package io.quarkus.it.resteasy.reactive.kotlin | ||
|
||
import javax.ws.rs.GET | ||
import javax.ws.rs.Path | ||
|
||
@Path("/greeting") | ||
class GreetingResource { | ||
|
||
@GET | ||
suspend fun testSuspend() = Greeting("hello") | ||
} | ||
|
||
data class Greeting(val message:String) |
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
21 changes: 21 additions & 0 deletions
21
...n/standard/src/test/kotlin/io/quarkus/it/resteasy/reactive/kotlin/GreetingResourceTest.kt
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,21 @@ | ||
package io.quarkus.it.resteasy.reactive.kotlin | ||
|
||
import io.quarkus.test.junit.QuarkusTest | ||
import io.restassured.RestAssured | ||
import io.restassured.http.ContentType | ||
import org.hamcrest.CoreMatchers | ||
import org.junit.jupiter.api.Test | ||
|
||
@QuarkusTest | ||
class GreetingResourceTest { | ||
|
||
@Test | ||
fun testDataClass() { | ||
RestAssured.given() | ||
.`when`()["/greeting"] | ||
.then() | ||
.statusCode(200) | ||
.contentType(ContentType.JSON) | ||
.body("message", CoreMatchers.`is`("hello")) | ||
} | ||
} |
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