Skip to content

Commit 4b51f6b

Browse files
committed
fix unit test + copyright notice
1 parent 43a0722 commit 4b51f6b

File tree

17 files changed

+38
-15
lines changed

17 files changed

+38
-15
lines changed

graphql-kotlin-boot-server/src/main/kotlin/com/expediagroup/graphql/boot/server/FederationAutoConfiguration.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 Expedia Group, Inc.
2+
* Copyright 2019 Expedia, Inc
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

graphql-kotlin-boot-server/src/main/kotlin/com/expediagroup/graphql/boot/server/GraphQLAutoConfiguration.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 Expedia Group, Inc.
2+
* Copyright 2019 Expedia, Inc
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

graphql-kotlin-boot-server/src/main/kotlin/com/expediagroup/graphql/boot/server/GraphQLConfigurationProperties.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 Expedia Group, Inc.
2+
* Copyright 2019 Expedia, Inc
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

graphql-kotlin-boot-server/src/main/kotlin/com/expediagroup/graphql/boot/server/QueryHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 Expedia Group, Inc.
2+
* Copyright 2019 Expedia, Inc
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

graphql-kotlin-boot-server/src/main/kotlin/com/expediagroup/graphql/boot/server/RoutesConfiguration.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 Expedia Group, Inc.
2+
* Copyright 2019 Expedia, Inc
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

graphql-kotlin-boot-server/src/main/kotlin/com/expediagroup/graphql/boot/server/SchemaAutoConfiguration.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 Expedia Group, Inc.
2+
* Copyright 2019 Expedia, Inc
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

graphql-kotlin-boot-server/src/main/kotlin/com/expediagroup/graphql/boot/server/SubscriptionAutoConfiguration.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 Expedia Group, Inc.
2+
* Copyright 2019 Expedia, Inc
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

graphql-kotlin-boot-server/src/main/kotlin/com/expediagroup/graphql/boot/server/SubscriptionHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 Expedia Group, Inc.
2+
* Copyright 2019 Expedia, Inc
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

graphql-kotlin-boot-server/src/main/kotlin/com/expediagroup/graphql/boot/server/annotation/Mutation.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 Expedia Group, Inc.
2+
* Copyright 2019 Expedia, Inc
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

graphql-kotlin-boot-server/src/main/kotlin/com/expediagroup/graphql/boot/server/annotation/Query.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 Expedia Group, Inc.
2+
* Copyright 2019 Expedia, Inc
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

graphql-kotlin-boot-server/src/main/kotlin/com/expediagroup/graphql/boot/server/annotation/Subscription.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 Expedia Group, Inc.
2+
* Copyright 2019 Expedia, Inc
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

graphql-kotlin-boot-server/src/main/kotlin/com/expediagroup/graphql/boot/server/exception/KotlinDataFetcherExceptionHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 Expedia Group, Inc.
2+
* Copyright 2019 Expedia, Inc
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

graphql-kotlin-boot-server/src/main/kotlin/com/expediagroup/graphql/boot/server/exception/SimpleKotlinGraphQLError.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 Expedia Group, Inc.
2+
* Copyright 2019 Expedia, Inc
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

graphql-kotlin-boot-server/src/main/kotlin/com/expediagroup/graphql/boot/server/model/GraphQLRequest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 Expedia Group, Inc.
2+
* Copyright 2019 Expedia, Inc
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

graphql-kotlin-boot-server/src/main/kotlin/com/expediagroup/graphql/boot/server/model/GraphQLResponse.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 Expedia Group, Inc.
2+
* Copyright 2019 Expedia, Inc
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

graphql-kotlin-schema-generator/src/test/kotlin/com/expediagroup/graphql/generator/extensions/KClassExtensionsTest.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import com.expediagroup.graphql.exceptions.CouldNotGetNameOfKClassException
2121
import com.expediagroup.graphql.hooks.NoopSchemaGeneratorHooks
2222
import com.expediagroup.graphql.hooks.SchemaGeneratorHooks
2323
import org.junit.jupiter.api.Test
24+
import org.junit.jupiter.api.condition.EnabledOnJre
25+
import org.junit.jupiter.api.condition.JRE
2426
import kotlin.reflect.KClass
2527
import kotlin.reflect.KFunction
2628
import kotlin.reflect.KProperty
@@ -225,14 +227,23 @@ open class KClassExtensionsTest {
225227
assertFalse(InvalidFunctionUnionInterface::class.isUnion())
226228
}
227229

230+
// with Kotlin 1.3.40+ there is bug on JRE 1.8 that results in incorrect simple name of the anonymous classes
231+
// https://youtrack.jetbrains.com/issue/KT-23072
228232
@Test
233+
@EnabledOnJre(JRE.JAVA_11)
229234
fun `test class simple name`() {
230235
assertEquals("MyTestClass", MyTestClass::class.getSimpleName())
231236
assertFailsWith(CouldNotGetNameOfKClassException::class) {
232237
object { }::class.getSimpleName()
233238
}
234239
}
235240

241+
@Test
242+
@EnabledOnJre(JRE.JAVA_8)
243+
fun `test class simple name on JRE 8`() {
244+
assertEquals("MyTestClass", MyTestClass::class.getSimpleName())
245+
}
246+
236247
@Test
237248
fun `test class simple name with GraphQLName`() {
238249
assertEquals("MyTestClassRenamed", MyTestClassCustomName::class.getSimpleName())

graphql-kotlin-schema-generator/src/test/kotlin/com/expediagroup/graphql/generator/extensions/KTypeExtensionsKtTest.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import com.expediagroup.graphql.exceptions.InvalidListTypeException
2121
import io.mockk.every
2222
import io.mockk.mockk
2323
import org.junit.jupiter.api.Test
24+
import org.junit.jupiter.api.condition.EnabledOnJre
25+
import org.junit.jupiter.api.condition.JRE
2426
import kotlin.reflect.KType
2527
import kotlin.reflect.KTypeProjection
2628
import kotlin.reflect.full.findParameterByName
@@ -88,7 +90,10 @@ internal class KTypeExtensionsKtTest {
8890
}
8991
}
9092

93+
// with Kotlin 1.3.40+ there is bug on JRE 1.8 that results in incorrect simple name of the anonymous classes
94+
// https://youtrack.jetbrains.com/issue/KT-23072
9195
@Test
96+
@EnabledOnJre(JRE.JAVA_11)
9297
fun getSimpleName() {
9398
assertEquals("MyClass", MyClass::class.starProjectedType.getSimpleName())
9499
assertEquals("MyClassInput", MyClass::class.starProjectedType.getSimpleName(isInputType = true))
@@ -97,6 +102,13 @@ internal class KTypeExtensionsKtTest {
97102
}
98103
}
99104

105+
@Test
106+
@EnabledOnJre(JRE.JAVA_8)
107+
fun getSimpleNameJava8() {
108+
assertEquals("MyClass", MyClass::class.starProjectedType.getSimpleName())
109+
assertEquals("MyClassInput", MyClass::class.starProjectedType.getSimpleName(isInputType = true))
110+
}
111+
100112
@Test
101113
fun qualifiedName() {
102114
assertEquals("com.expediagroup.graphql.generator.extensions.KTypeExtensionsKtTest.MyClass", MyClass::class.starProjectedType.qualifiedName)

0 commit comments

Comments
 (0)