File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
src/test/kotlin/org/dataloader Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package org.dataloader
2
2
3
3
import org.junit.jupiter.api.Test
4
4
import java.util.concurrent.CompletableFuture
5
+ import java.util.concurrent.CompletableFuture.*
5
6
6
7
/* *
7
8
* Some Kotlin code to prove that are JSpecify annotations work here
@@ -12,28 +13,28 @@ class KotlinExamples {
12
13
13
14
@Test
14
15
fun `basic kotlin test of non nullable value types` () {
15
- val dataLoader: DataLoader <String , String > = DataLoaderFactory .newDataLoader { keys -> CompletableFuture . completedFuture(keys.toList()) }
16
+ val dataLoader: DataLoader <String , String > = DataLoaderFactory .newDataLoader { keys -> completedFuture(keys.toList()) }
16
17
17
18
val cfA = dataLoader.load(" A" )
18
19
val cfB = dataLoader.load(" B" )
19
20
20
21
dataLoader.dispatch()
21
22
22
- cfA.join().equals(" A" )
23
- cfB .join().equals(" B " )
23
+ assert ( cfA.join().equals(" A" ) )
24
+ assert (cfA .join().equals(" A " ) )
24
25
}
25
26
26
27
@Test
27
28
fun `basic kotlin test of nullable value types` () {
28
- val dataLoader: DataLoader <String , String ?> = DataLoaderFactory .newDataLoader { keys -> CompletableFuture . completedFuture(keys.toList()) }
29
+ val dataLoader: DataLoader <String , String ?> = DataLoaderFactory .newDataLoader { keys -> completedFuture(keys.toList()) }
29
30
30
31
val cfA = dataLoader.load(" A" )
31
32
val cfB = dataLoader.load(" B" )
32
33
33
34
dataLoader.dispatch()
34
35
35
- cfA.join().equals(" A" )
36
- cfB .join().equals(" B " )
36
+ assert ( cfA.join().equals(" A" ) )
37
+ assert (cfA .join().equals(" A " ) )
37
38
}
38
39
39
40
}
You can’t perform that action at this time.
0 commit comments