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 1212 <packaging >jar</packaging >
1313
1414 <properties >
15- <spring-boot .version>2.2.0.M6 </spring-boot .version>
15+ <spring-boot .version>2.2.0.RC1 </spring-boot .version>
1616 <reactor .version>3.3.0.RELEASE</reactor .version>
1717 <reactor-kotlin-extensions .version>1.0.0.RELEASE</reactor-kotlin-extensions .version>
1818 </properties >
Original file line number Diff line number Diff line change @@ -24,9 +24,9 @@ import org.springframework.context.annotation.Configuration
2424import org.springframework.core.io.Resource
2525import org.springframework.web.reactive.function.server.RouterFunction
2626import org.springframework.web.reactive.function.server.ServerResponse
27+ import org.springframework.web.reactive.function.server.bodyValueAndAwait
2728import org.springframework.web.reactive.function.server.coRouter
2829import org.springframework.web.reactive.function.server.html
29- import org.springframework.web.reactive.function.server.bodyAndAwait
3030
3131/* *
3232 * SpringBoot auto configuration for generating Playground Service.
@@ -48,7 +48,7 @@ class PlaygroundAutoConfiguration(
4848 }
4949 return coRouter {
5050 GET (config.playground.endpoint) {
51- ok().html().bodyAndAwait (body)
51+ ok().html().bodyValueAndAwait (body)
5252 }
5353 }
5454 }
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ import org.springframework.http.HttpMethod
3030import org.springframework.http.MediaType
3131import org.springframework.web.reactive.function.server.ServerRequest
3232import 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
3434import org.springframework.web.reactive.function.server.buildAndAwait
3535import org.springframework.web.reactive.function.server.coRouter
3636import org.springframework.web.reactive.function.server.json
@@ -55,13 +55,13 @@ class RoutesConfiguration(
5555 val graphQLRequest = createGraphQLRequest(serverRequest)
5656 if (graphQLRequest != null ) {
5757 val graphQLResult = queryHandler.executeQuery(graphQLRequest)
58- ok().json().bodyAndAwait (graphQLResult)
58+ ok().json().bodyValueAndAwait (graphQLResult)
5959 } else {
6060 badRequest().buildAndAwait()
6161 }
6262 }
6363 GET (" /sdl" ) {
64- ok().contentType(MediaType .TEXT_PLAIN ).bodyAndAwait (schema.print ())
64+ ok().contentType(MediaType .TEXT_PLAIN ).bodyValueAndAwait (schema.print ())
6565 }
6666 }
6767
Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ import com.expediagroup.graphql.spring.model.SubscriptionOperationMessage.Server
3131import com.expediagroup.graphql.spring.model.SubscriptionOperationMessage.ServerMessages.GQL_ERROR
3232import com.fasterxml.jackson.module.kotlin.convertValue
3333import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
34- import com.fasterxml.jackson.module.kotlin.registerKotlinModule
3534import io.mockk.every
3635import io.mockk.mockk
3736import io.mockk.verify
@@ -46,7 +45,7 @@ import kotlin.test.assertTrue
4645
4746class ApolloSubscriptionProtocolHandlerTest {
4847
49- private val objectMapper = jacksonObjectMapper().registerKotlinModule()
48+ private val objectMapper = jacksonObjectMapper()
5049
5150 @Test
5251 fun `Return GQL_CONNECTION_ERROR when payload is not a SubscriptionOperationMessage` () {
@@ -296,10 +295,9 @@ class ApolloSubscriptionProtocolHandlerTest {
296295 assertNotNull(message)
297296 assertEquals(expected = GQL_ERROR .type, actual = message.type)
298297 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 )
303301
304302 verify(exactly = 0 ) { session.close() }
305303 }
Original file line number Diff line number Diff line change 6262
6363 <!-- Dependency Versions -->
6464 <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>
6666 <kotlin .version>1.3.50</kotlin .version>
6767 <kotlin-coroutines .version>1.3.2</kotlin-coroutines .version>
6868 <reflections .version>0.9.11</reflections .version>
You can’t perform that action at this time.
0 commit comments