-
Notifications
You must be signed in to change notification settings - Fork 2.5k
/
SharedResourceTest.kt
40 lines (36 loc) · 1.09 KB
/
SharedResourceTest.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package io.quarkus.it.resteasy.reactive.kotlin
import io.quarkus.test.junit.QuarkusTest
import io.restassured.http.ContentType
import io.restassured.module.kotlin.extensions.Given
import io.restassured.module.kotlin.extensions.Then
import io.restassured.module.kotlin.extensions.When
import org.hamcrest.CoreMatchers
import org.junit.jupiter.api.Test
@QuarkusTest
class SharedResourceTest {
@Test
fun testReturnAsIs() {
Given {
body("""{ "message": "will not be used" }""")
contentType(ContentType.JSON)
} When {
post("/shared")
} Then {
statusCode(200)
body(CoreMatchers.`is`("""{"message": "canned+canned"}"""))
}
}
@Test
fun testApplicationSuppliedProviderIsPreferred() {
Given {
body("""{ "message": "will not be used" }""")
contentType(ContentType.TEXT)
accept(ContentType.TEXT)
} When {
post("/shared")
} Then {
statusCode(200)
body(CoreMatchers.`is`("""{"message": "app+app"}"""))
}
}
}