Skip to content

Commit 4d51b9a

Browse files
authored
[spring-server] update to use Spring Boot RC1 (#421)
1 parent aa8b4a6 commit 4d51b9a

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

graphql-kotlin-spring-server/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
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>

graphql-kotlin-spring-server/src/main/kotlin/com/expediagroup/graphql/spring/PlaygroundAutoConfiguration.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import org.springframework.context.annotation.Configuration
2424
import org.springframework.core.io.Resource
2525
import org.springframework.web.reactive.function.server.RouterFunction
2626
import org.springframework.web.reactive.function.server.ServerResponse
27+
import org.springframework.web.reactive.function.server.bodyValueAndAwait
2728
import org.springframework.web.reactive.function.server.coRouter
2829
import 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
}

graphql-kotlin-spring-server/src/main/kotlin/com/expediagroup/graphql/spring/RoutesConfiguration.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import org.springframework.http.HttpMethod
3030
import org.springframework.http.MediaType
3131
import org.springframework.web.reactive.function.server.ServerRequest
3232
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
3434
import org.springframework.web.reactive.function.server.buildAndAwait
3535
import org.springframework.web.reactive.function.server.coRouter
3636
import 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

graphql-kotlin-spring-server/src/test/kotlin/com/expediagroup/graphql/spring/execution/ApolloSubscriptionProtocolHandlerTest.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import com.expediagroup.graphql.spring.model.SubscriptionOperationMessage.Server
3131
import com.expediagroup.graphql.spring.model.SubscriptionOperationMessage.ServerMessages.GQL_ERROR
3232
import com.fasterxml.jackson.module.kotlin.convertValue
3333
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
34-
import com.fasterxml.jackson.module.kotlin.registerKotlinModule
3534
import io.mockk.every
3635
import io.mockk.mockk
3736
import io.mockk.verify
@@ -46,7 +45,7 @@ import kotlin.test.assertTrue
4645

4746
class 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
}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
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>

0 commit comments

Comments
 (0)