Skip to content

Commit 275e2ab

Browse files
authored
1 parent 2318398 commit 275e2ab

File tree

4 files changed

+35
-34
lines changed

4 files changed

+35
-34
lines changed

executions/graphql-kotlin-dataloader-instrumentation/src/main/kotlin/com/expediagroup/graphql/dataloader/instrumentation/extensions/FieldValueInfosExtensions.kt

-31
This file was deleted.

gradle/libs.versions.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ graphql-java = "22.1"
77
graalvm = "0.10.2"
88
jackson = "2.17.1"
99
# kotlin version has to match the compile-testing compiler version
10-
kotlin = "1.9.24"
10+
kotlin = "2.0.0"
1111
kotlinx-benchmark = "0.4.11"
1212
kotlinx-coroutines = "1.8.1"
1313
# TODO kotlin 1.9 upgrade: fix GraphQLTestUtils and GenerateKotlinxClientIT
@@ -29,7 +29,7 @@ spring-boot = "3.2.7"
2929
commons-codec = { strictly = "[1.13, 2[", prefer = "1.16.0" }
3030

3131
# test dependencies
32-
compile-testing = "0.5.0"
32+
compile-testing = "0.5.1"
3333
icu = "75.1"
3434
junit = "5.10.2"
3535
logback = "1.5.6"

plugins/server/graphql-kotlin-graalvm-metadata-generator/src/main/kotlin/com/expediagroup/graphql/plugin/graalvm/MetadataCapturingDataFetcherFactoryProvider.kt

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ internal class MetadataCapturingDataFetcherFactoryProvider(val scanResult: ScanR
3232
// we need to capture enums
3333
private val additionalTypes: MutableSet<String> = HashSet()
3434

35-
@OptIn(ExperimentalStdlibApi::class)
3635
override fun functionDataFetcherFactory(target: Any?, kClass: KClass<*>, kFunction: KFunction<*>): DataFetcherFactory<Any?> {
3736
val methodName = kFunction.javaMethod!!.name
3837
val classMetadata = reflectMetadataMap.getOrPut(kClass.java.name) { MutableClassMetadata(name = kClass.java.name, methods = ArrayList()) }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import com.expediagroup.graphql.plugin.graalvm.MetadataCapturingDataFetcherFactoryProvider
2+
import com.expediagroup.graphql.plugin.graalvm.enums.EnumQuery
3+
import io.github.classgraph.ClassGraph
4+
import io.github.classgraph.ScanResult
5+
import org.junit.jupiter.api.Assertions
6+
import org.junit.jupiter.api.BeforeEach
7+
import org.junit.jupiter.api.Test
8+
import kotlin.reflect.KFunction
9+
10+
class MetadataCapturingDataFetcherFactoryProviderTest {
11+
12+
private lateinit var scanResult: ScanResult
13+
private lateinit var provider: MetadataCapturingDataFetcherFactoryProvider
14+
15+
@BeforeEach
16+
fun setup() {
17+
scanResult = ClassGraph().enableAllInfo().acceptPackages("com.expediagroup.graphql.plugin.graalvm").scan()
18+
provider = MetadataCapturingDataFetcherFactoryProvider(scanResult, listOf("com.expediagroup.graphql.plugin.graalvm"))
19+
20+
val kClass = EnumQuery::class
21+
val kFunction = kClass.members.find { it.name == "enumArgQuery" } as KFunction<*>
22+
provider.functionDataFetcherFactory(null, kClass, kFunction)
23+
}
24+
25+
@Test
26+
fun `reflectMetadata should not be empty`() {
27+
val metadata = provider.reflectMetadata()
28+
29+
Assertions.assertNotNull(metadata)
30+
Assertions.assertTrue(metadata.isNotEmpty(), "Reflect metadata should not be empty")
31+
Assertions.assertEquals(listOf("com.expediagroup.graphql.plugin.graalvm"), provider.supportedPackages)
32+
}
33+
}

0 commit comments

Comments
 (0)