1
1
import commonTests.team.*
2
2
import jetbrains.kotlin.course.words.generator.util.words
3
+ import org.jetbrains.academy.test.system.findMethod
3
4
import org.jetbrains.academy.test.system.models.classes.ConstructorGetter
4
5
import org.jetbrains.academy.test.system.models.classes.findClass
5
6
import org.jetbrains.academy.test.system.models.method.TestMethodInvokeData
7
+ import org.junit.jupiter.api.Assertions
6
8
import org.junit.jupiter.api.Test
7
9
import org.junit.jupiter.params.ParameterizedTest
8
10
import org.junit.jupiter.params.provider.Arguments
9
11
import org.junit.jupiter.params.provider.MethodSource
10
12
import java.lang.reflect.Field
13
+ import kotlin.reflect.jvm.kotlinFunction
11
14
12
15
class Test {
13
16
companion object {
@@ -33,6 +36,14 @@ class Test {
33
36
ConstructorGetter (),
34
37
)
35
38
)
39
+
40
+ val methodKFunction = clazz.methods.findMethod(getAllGameResultsMethod).kotlinFunction
41
+ val methodReturnType = (methodKFunction ? : error(" Method getAllGameResults doesn't exist" )).returnType
42
+ Assertions .assertTrue(methodReturnType.arguments.size == 1 ,
43
+ " Return type of method getAllGameResults should have 1 type argument" )
44
+ Assertions .assertTrue((methodReturnType.arguments.first().type?.toString() ? : " " ).contains(" GameResult" ),
45
+ " Return type of method getAllGameResults should be specified explicitly as List<GameResult>" )
46
+
36
47
gameResultsServiceTestClass.checkDeclaredMethods(clazz)
37
48
}
38
49
@@ -233,4 +244,4 @@ class Test {
233
244
getIdFromTeamMethod
234
245
) { constructor .newInstance() }
235
246
}
236
- }
247
+ }
0 commit comments