Skip to content

Commit 79fc736

Browse files
mervyn-mccreightstuebingerb
authored andcommitted
test: use runTest of coroutines.test
1 parent 4b594b1 commit 79fc736

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

kgraphql-ktor-stitched/src/test/kotlin/com/apurebase/kgraphql/stitched/schema/structure/IntrospectedSchemaTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import com.apurebase.kgraphql.KGraphQL
44
import com.apurebase.kgraphql.request.Introspection
55
import com.apurebase.kgraphql.schema.SchemaPrinter
66
import io.kotest.matchers.shouldBe
7+
import kotlinx.coroutines.test.runTest
78
import org.junit.jupiter.api.Test
89

910
class IntrospectedSchemaTest {
@@ -15,7 +16,7 @@ class IntrospectedSchemaTest {
1516
}
1617

1718
@Test
18-
suspend fun `introspected schema should result in the same SDL as the schema itself`() {
19+
fun `introspected schema should result in the same SDL as the schema itself`() = runTest {
1920
val schema = KGraphQL.schema {
2021
extendedScalars()
2122

kgraphql-ktor-stitched/src/test/kotlin/com/apurebase/kgraphql/stitched/schema/structure/StitchedSchemaTest.kt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import com.apurebase.kgraphql.stitched.schema.configuration.StitchedSchemaConfig
1616
import com.apurebase.kgraphql.stitched.schema.execution.RemoteRequestExecutor
1717
import com.fasterxml.jackson.databind.JsonNode
1818
import io.kotest.matchers.shouldBe
19+
import kotlinx.coroutines.test.runTest
1920
import org.junit.jupiter.api.Test
2021
import java.util.Locale
2122
import java.util.UUID
@@ -77,7 +78,7 @@ class StitchedSchemaTest {
7778
}
7879

7980
@Test
80-
suspend fun `stitched schema should skip duplicate types by name and prefer local types`() {
81+
fun `stitched schema should skip duplicate types by name and prefer local types`() = runTest {
8182
val schema = StitchedKGraphQL.stitchedSchema {
8283
configure {
8384
remoteExecutor = DummyRemoteRequestExecutor
@@ -113,7 +114,7 @@ class StitchedSchemaTest {
113114
}
114115

115116
@Test
116-
suspend fun `stitched schema should include local and remote types with proper fields`() {
117+
fun `stitched schema should include local and remote types with proper fields`() = runTest {
117118
val schema = StitchedKGraphQL.stitchedSchema {
118119
configure {
119120
remoteExecutor = DummyRemoteRequestExecutor
@@ -174,7 +175,7 @@ class StitchedSchemaTest {
174175
}
175176

176177
@Test
177-
suspend fun `stitched schema should include union types with proper possible types`() {
178+
fun `stitched schema should include union types with proper possible types`() = runTest {
178179
val schema = StitchedKGraphQL.stitchedSchema {
179180
configure {
180181
remoteExecutor = DummyRemoteRequestExecutor
@@ -214,7 +215,7 @@ class StitchedSchemaTest {
214215
}
215216

216217
@Test
217-
suspend fun `stitched schema should include all local and remote queries`() {
218+
fun `stitched schema should include all local and remote queries`() = runTest {
218219
val schema = StitchedKGraphQL.stitchedSchema {
219220
configure {
220221
remoteExecutor = DummyRemoteRequestExecutor
@@ -283,7 +284,7 @@ class StitchedSchemaTest {
283284
}
284285

285286
@Test
286-
suspend fun `stitched schema should include all local and remote mutations`() {
287+
fun `stitched schema should include all local and remote mutations`() = runTest {
287288
val schema = StitchedKGraphQL.stitchedSchema {
288289
configure {
289290
remoteExecutor = DummyRemoteRequestExecutor
@@ -351,7 +352,7 @@ class StitchedSchemaTest {
351352
}
352353

353354
@Test
354-
suspend fun `schema with remote input types should be printed as expected`() {
355+
fun `schema with remote input types should be printed as expected`() = runTest {
355356
data class TestObject(val name: String)
356357

357358
val schema = StitchedKGraphQL.stitchedSchema {
@@ -394,7 +395,7 @@ class StitchedSchemaTest {
394395
}
395396

396397
@Test
397-
suspend fun `schema with remote extension properties should be printed as expected`() {
398+
fun `schema with remote extension properties should be printed as expected`() = runTest {
398399
data class TestObject(val name: String)
399400

400401
val schema = StitchedKGraphQL.stitchedSchema {
@@ -440,7 +441,7 @@ class StitchedSchemaTest {
440441
}
441442

442443
@Test
443-
suspend fun `schema with deprecated remote fields should be printed as expected`() {
444+
fun `schema with deprecated remote fields should be printed as expected`() = runTest {
444445
data class TestObject(val name: String)
445446

446447
val schema = StitchedKGraphQL.stitchedSchema {
@@ -489,7 +490,7 @@ class StitchedSchemaTest {
489490
class Face(override val value: String, override val value2: Boolean = false) : InterInter
490491

491492
@Test
492-
suspend fun `schema with remote interfaces should be printed as expected`() {
493+
fun `schema with remote interfaces should be printed as expected`() = runTest {
493494
val schema = StitchedKGraphQL.stitchedSchema {
494495
configure {
495496
remoteExecutor = DummyRemoteRequestExecutor
@@ -655,7 +656,7 @@ class StitchedSchemaTest {
655656

656657
// TODO: make configurable? this doesn't seem like *always* intended
657658
@Test
658-
suspend fun `stitched operations should include optional input arguments`() {
659+
fun `stitched operations should include optional input arguments`() = runTest {
659660
data class SimpleClass(val existing: String)
660661

661662
val schema = StitchedKGraphQL.stitchedSchema {

0 commit comments

Comments
 (0)