File tree Expand file tree Collapse file tree 5 files changed +11
-13
lines changed
graphql-kotlin-spring-server
main/kotlin/com/expediagroup/graphql/spring
test/kotlin/com/expediagroup/graphql/spring/execution Expand file tree Collapse file tree 5 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 12
12
<packaging >jar</packaging >
13
13
14
14
<properties >
15
- <spring-boot .version>2.2.0.M6 </spring-boot .version>
15
+ <spring-boot .version>2.2.0.RC1 </spring-boot .version>
16
16
<reactor .version>3.3.0.RELEASE</reactor .version>
17
17
<reactor-kotlin-extensions .version>1.0.0.RELEASE</reactor-kotlin-extensions .version>
18
18
</properties >
Original file line number Diff line number Diff line change @@ -24,9 +24,9 @@ import org.springframework.context.annotation.Configuration
24
24
import org.springframework.core.io.Resource
25
25
import org.springframework.web.reactive.function.server.RouterFunction
26
26
import org.springframework.web.reactive.function.server.ServerResponse
27
+ import org.springframework.web.reactive.function.server.bodyValueAndAwait
27
28
import org.springframework.web.reactive.function.server.coRouter
28
29
import org.springframework.web.reactive.function.server.html
29
- import org.springframework.web.reactive.function.server.bodyAndAwait
30
30
31
31
/* *
32
32
* SpringBoot auto configuration for generating Playground Service.
@@ -48,7 +48,7 @@ class PlaygroundAutoConfiguration(
48
48
}
49
49
return coRouter {
50
50
GET (config.playground.endpoint) {
51
- ok().html().bodyAndAwait (body)
51
+ ok().html().bodyValueAndAwait (body)
52
52
}
53
53
}
54
54
}
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ import org.springframework.http.HttpMethod
30
30
import org.springframework.http.MediaType
31
31
import org.springframework.web.reactive.function.server.ServerRequest
32
32
import org.springframework.web.reactive.function.server.awaitBody
33
- import org.springframework.web.reactive.function.server.bodyAndAwait
33
+ import org.springframework.web.reactive.function.server.bodyValueAndAwait
34
34
import org.springframework.web.reactive.function.server.buildAndAwait
35
35
import org.springframework.web.reactive.function.server.coRouter
36
36
import org.springframework.web.reactive.function.server.json
@@ -55,13 +55,13 @@ class RoutesConfiguration(
55
55
val graphQLRequest = createGraphQLRequest(serverRequest)
56
56
if (graphQLRequest != null ) {
57
57
val graphQLResult = queryHandler.executeQuery(graphQLRequest)
58
- ok().json().bodyAndAwait (graphQLResult)
58
+ ok().json().bodyValueAndAwait (graphQLResult)
59
59
} else {
60
60
badRequest().buildAndAwait()
61
61
}
62
62
}
63
63
GET (" /sdl" ) {
64
- ok().contentType(MediaType .TEXT_PLAIN ).bodyAndAwait (schema.print ())
64
+ ok().contentType(MediaType .TEXT_PLAIN ).bodyValueAndAwait (schema.print ())
65
65
}
66
66
}
67
67
Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ import com.expediagroup.graphql.spring.model.SubscriptionOperationMessage.Server
31
31
import com.expediagroup.graphql.spring.model.SubscriptionOperationMessage.ServerMessages.GQL_ERROR
32
32
import com.fasterxml.jackson.module.kotlin.convertValue
33
33
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
34
- import com.fasterxml.jackson.module.kotlin.registerKotlinModule
35
34
import io.mockk.every
36
35
import io.mockk.mockk
37
36
import io.mockk.verify
@@ -46,7 +45,7 @@ import kotlin.test.assertTrue
46
45
47
46
class ApolloSubscriptionProtocolHandlerTest {
48
47
49
- private val objectMapper = jacksonObjectMapper().registerKotlinModule()
48
+ private val objectMapper = jacksonObjectMapper()
50
49
51
50
@Test
52
51
fun `Return GQL_CONNECTION_ERROR when payload is not a SubscriptionOperationMessage` () {
@@ -296,10 +295,9 @@ class ApolloSubscriptionProtocolHandlerTest {
296
295
assertNotNull(message)
297
296
assertEquals(expected = GQL_ERROR .type, actual = message.type)
298
297
assertEquals(expected = " abc" , actual = message.id)
299
- val payload = message.payload
300
- assertNotNull(payload)
301
- val graphQLResponse: GraphQLResponse = objectMapper.convertValue(payload)
302
- assertTrue(graphQLResponse.errors?.isNotEmpty() == true )
298
+ val response = message.payload as ? GraphQLResponse
299
+ assertNotNull(response)
300
+ assertTrue(response.errors?.isNotEmpty() == true )
303
301
304
302
verify(exactly = 0 ) { session.close() }
305
303
}
Original file line number Diff line number Diff line change 62
62
63
63
<!-- Dependency Versions -->
64
64
<graphql-java .version>13.0</graphql-java .version>
65
- <jackson-module-kotlin .version>2.9.10 </jackson-module-kotlin .version>
65
+ <jackson-module-kotlin .version>2.10.0 </jackson-module-kotlin .version>
66
66
<kotlin .version>1.3.50</kotlin .version>
67
67
<kotlin-coroutines .version>1.3.2</kotlin-coroutines .version>
68
68
<reflections .version>0.9.11</reflections .version>
You can’t perform that action at this time.
0 commit comments