File tree Expand file tree Collapse file tree
main/kotlin/graphql/kickstart/tools/util
test/kotlin/graphql/kickstart/tools Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,8 +9,6 @@ import graphql.schema.idl.TypeUtil
99import kotlinx.coroutines.CoroutineScope
1010import kotlinx.coroutines.Dispatchers
1111import org.apache.commons.lang3.reflect.TypeUtils
12- import org.slf4j.LoggerFactory
13- import java.lang.invoke.MethodHandles
1412import java.lang.reflect.Method
1513import java.lang.reflect.ParameterizedType
1614import java.lang.reflect.Proxy
@@ -22,8 +20,6 @@ import kotlin.reflect.jvm.kotlinFunction
2220 * @author Andrew Potter
2321 */
2422
25- private val log = LoggerFactory .getLogger(MethodHandles .lookup().lookupClass())
26-
2723internal typealias GraphQLRootResolver = GraphQLResolver <Void >
2824
2925internal typealias JavaType = java.lang.reflect.Type
@@ -70,17 +66,6 @@ internal fun DataFetchingEnvironment.coroutineScope(): CoroutineScope {
7066 return scope
7167 }
7268
73- @Suppress(" DEPRECATION" )
74- val context: Any? = this .getContext()
75- if (context is CoroutineScope ) {
76- log.warn(
77- " Passing a CoroutineScope as the context object has been deprecated by graphql-java. " +
78- " Please insert it into the GraphQLContext map under the CoroutineScope class key when building the ExecutionInput. " +
79- " Support for the context object will be removed in the next major release."
80- )
81- return context
82- }
83-
8469 return CoroutineScope (Dispatchers .Default )
8570}
8671
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ class MethodFieldResolverDataFetcherTest {
9898 }
9999
100100 @Test
101- fun `data fetcher executes suspend function in CoroutineScope from legacy context` () {
101+ fun `data fetcher does not execute suspend function in CoroutineScope from legacy context` () {
102102 // setup
103103 val scopeClass = ScopeClass ()
104104
@@ -107,7 +107,7 @@ class MethodFieldResolverDataFetcherTest {
107107 // expect
108108 @Suppress(" UNCHECKED_CAST" )
109109 val future = resolver.get(createEnvironment(DataClass (), legacyContext = scopeClass.scope)) as CompletableFuture <Boolean >
110- assert (future.get())
110+ assertEquals (future.get(), false )
111111 }
112112
113113 class ScopeClass : GraphQLResolver <DataClass > {
@@ -116,7 +116,7 @@ class MethodFieldResolverDataFetcherTest {
116116
117117 @Suppress(" UNUSED_PARAMETER" )
118118 suspend fun isActive (data : DataClass ): Boolean {
119- return coroutineContext[Job ] == job.children.first ()
119+ return coroutineContext[Job ] == job.children.firstOrNull ()
120120 }
121121 }
122122
You can’t perform that action at this time.
0 commit comments