Merge branch '6.0.x'
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -27,7 +27,7 @@ import java.lang.reflect.Method
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
class KotlinBindingReflectionHintsRegistrarTests {
|
||||
class BindingReflectionHintsRegistrarKotlinTests {
|
||||
|
||||
private val bindingRegistrar = BindingReflectionHintsRegistrar()
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.springframework.util.ReflectionUtils
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
abstract class AbstractKotlinReflectionParameterNameDiscovererTests(protected val parameterNameDiscoverer: ParameterNameDiscoverer) {
|
||||
abstract class AbstractReflectionParameterNameDiscovererKotlinTests(protected val parameterNameDiscoverer: ParameterNameDiscoverer) {
|
||||
|
||||
@Test
|
||||
fun getParameterNamesOnInterface() {
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,7 +19,12 @@ package org.springframework.core
|
||||
import org.assertj.core.api.Assertions.assertThat
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
class KotlinBridgeMethodResolverTests {
|
||||
/**
|
||||
* Kotlin tests for [BridgeMethodResolver].
|
||||
*
|
||||
* @author Sebastien Deleuzes
|
||||
*/
|
||||
class BridgeMethodResolverKotlinTests {
|
||||
|
||||
@Test
|
||||
fun findBridgedMethod() {
|
||||
@@ -28,7 +28,12 @@ import reactor.test.StepVerifier
|
||||
import kotlin.coroutines.Continuation
|
||||
import kotlin.coroutines.coroutineContext
|
||||
|
||||
class KotlinCoroutinesUtilsTests {
|
||||
/**
|
||||
* Kotlin tests for [CoroutinesUtils].
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
class CoroutinesUtilsTests {
|
||||
|
||||
@Test
|
||||
fun deferredToMono() {
|
||||
@@ -56,7 +61,7 @@ class KotlinCoroutinesUtilsTests {
|
||||
|
||||
@Test
|
||||
fun invokeSuspendingFunctionWithNullContinuationParameter() {
|
||||
val method = KotlinCoroutinesUtilsTests::class.java.getDeclaredMethod("suspendingFunction", String::class.java, Continuation::class.java)
|
||||
val method = CoroutinesUtilsTests::class.java.getDeclaredMethod("suspendingFunction", String::class.java, Continuation::class.java)
|
||||
val publisher = CoroutinesUtils.invokeSuspendingFunction(method, this, "foo", null)
|
||||
Assertions.assertThat(publisher).isInstanceOf(Mono::class.java)
|
||||
StepVerifier.create(publisher)
|
||||
@@ -67,7 +72,7 @@ class KotlinCoroutinesUtilsTests {
|
||||
|
||||
@Test
|
||||
fun invokeSuspendingFunctionWithoutContinuationParameter() {
|
||||
val method = KotlinCoroutinesUtilsTests::class.java.getDeclaredMethod("suspendingFunction", String::class.java, Continuation::class.java)
|
||||
val method = CoroutinesUtilsTests::class.java.getDeclaredMethod("suspendingFunction", String::class.java, Continuation::class.java)
|
||||
val publisher = CoroutinesUtils.invokeSuspendingFunction(method, this, "foo")
|
||||
Assertions.assertThat(publisher).isInstanceOf(Mono::class.java)
|
||||
StepVerifier.create(publisher)
|
||||
@@ -78,13 +83,13 @@ class KotlinCoroutinesUtilsTests {
|
||||
|
||||
@Test
|
||||
fun invokeNonSuspendingFunction() {
|
||||
val method = KotlinCoroutinesUtilsTests::class.java.getDeclaredMethod("nonSuspendingFunction", String::class.java)
|
||||
val method = CoroutinesUtilsTests::class.java.getDeclaredMethod("nonSuspendingFunction", String::class.java)
|
||||
Assertions.assertThatIllegalArgumentException().isThrownBy { CoroutinesUtils.invokeSuspendingFunction(method, this, "foo") }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun invokeSuspendingFunctionWithFlow() {
|
||||
val method = KotlinCoroutinesUtilsTests::class.java.getDeclaredMethod("suspendingFunctionWithFlow", Continuation::class.java)
|
||||
val method = CoroutinesUtilsTests::class.java.getDeclaredMethod("suspendingFunctionWithFlow", Continuation::class.java)
|
||||
val publisher = CoroutinesUtils.invokeSuspendingFunction(method, this)
|
||||
Assertions.assertThat(publisher).isInstanceOf(Flux::class.java)
|
||||
StepVerifier.create(publisher)
|
||||
@@ -96,7 +101,7 @@ class KotlinCoroutinesUtilsTests {
|
||||
|
||||
@Test
|
||||
fun invokeSuspendingFunctionWithNullContinuationParameterAndContext() {
|
||||
val method = KotlinCoroutinesUtilsTests::class.java.getDeclaredMethod("suspendingFunctionWithContext", String::class.java, Continuation::class.java)
|
||||
val method = CoroutinesUtilsTests::class.java.getDeclaredMethod("suspendingFunctionWithContext", String::class.java, Continuation::class.java)
|
||||
val context = CoroutineName("name")
|
||||
val mono = CoroutinesUtils.invokeSuspendingFunction(context, method, this, "foo", null) as Mono
|
||||
runBlocking {
|
||||
@@ -106,7 +111,7 @@ class KotlinCoroutinesUtilsTests {
|
||||
|
||||
@Test
|
||||
fun invokeSuspendingFunctionWithoutContinuationParameterAndContext() {
|
||||
val method = KotlinCoroutinesUtilsTests::class.java.getDeclaredMethod("suspendingFunctionWithContext", String::class.java, Continuation::class.java)
|
||||
val method = CoroutinesUtilsTests::class.java.getDeclaredMethod("suspendingFunctionWithContext", String::class.java, Continuation::class.java)
|
||||
val context = CoroutineName("name")
|
||||
val mono = CoroutinesUtils.invokeSuspendingFunction(context, method, this, "foo") as Mono
|
||||
runBlocking {
|
||||
@@ -116,7 +121,7 @@ class KotlinCoroutinesUtilsTests {
|
||||
|
||||
@Test
|
||||
fun invokeNonSuspendingFunctionWithContext() {
|
||||
val method = KotlinCoroutinesUtilsTests::class.java.getDeclaredMethod("nonSuspendingFunction", String::class.java)
|
||||
val method = CoroutinesUtilsTests::class.java.getDeclaredMethod("nonSuspendingFunction", String::class.java)
|
||||
val context = CoroutineName("name")
|
||||
Assertions.assertThatIllegalArgumentException().isThrownBy { CoroutinesUtils.invokeSuspendingFunction(context, method, this, "foo") }
|
||||
}
|
||||
@@ -24,8 +24,8 @@ import org.junit.jupiter.api.Test
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
class KotlinDefaultParameterNameDiscovererTests :
|
||||
AbstractKotlinReflectionParameterNameDiscovererTests(DefaultParameterNameDiscoverer()){
|
||||
class DefaultParameterNameDiscovererKotlinTests :
|
||||
AbstractReflectionParameterNameDiscovererKotlinTests(DefaultParameterNameDiscoverer()){
|
||||
|
||||
enum class MyEnum {
|
||||
ONE, TWO
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -27,7 +27,7 @@ import java.lang.reflect.Method
|
||||
* @author Konrad Kaminski
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
class KotlinGenericTypeResolverTests {
|
||||
class GenericTypeResolverKotlinTests {
|
||||
|
||||
@Test
|
||||
fun methodReturnTypes() {
|
||||
@@ -22,4 +22,4 @@ package org.springframework.core
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
class KotlinReflectionParameterNameDiscovererTests :
|
||||
AbstractKotlinReflectionParameterNameDiscovererTests(KotlinReflectionParameterNameDiscoverer())
|
||||
AbstractReflectionParameterNameDiscovererKotlinTests(KotlinReflectionParameterNameDiscoverer())
|
||||
|
||||
@@ -32,7 +32,7 @@ import kotlin.reflect.jvm.javaMethod
|
||||
* @author Juergen Hoeller
|
||||
* @author Konrad Kaminski
|
||||
*/
|
||||
class KotlinMethodParameterTests {
|
||||
class MethodParameterKotlinTests {
|
||||
|
||||
private val nullableMethod: Method = javaClass.getMethod("nullable", String::class.java)
|
||||
|
||||
@@ -40,10 +40,10 @@ class KotlinMethodParameterTests {
|
||||
|
||||
private val withDefaultValueMethod: Method = javaClass.getMethod("withDefaultValue", String::class.java)
|
||||
|
||||
private val innerClassConstructor = InnerClass::class.java.getConstructor(KotlinMethodParameterTests::class.java)
|
||||
private val innerClassConstructor = InnerClass::class.java.getConstructor(MethodParameterKotlinTests::class.java)
|
||||
|
||||
private val innerClassWithParametersConstructor = InnerClassWithParameter::class.java
|
||||
.getConstructor(KotlinMethodParameterTests::class.java, String::class.java, String::class.java)
|
||||
.getConstructor(MethodParameterKotlinTests::class.java, String::class.java, String::class.java)
|
||||
|
||||
private val regularClassConstructor = RegularClass::class.java.getConstructor(String::class.java, String::class.java)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -33,8 +33,13 @@ import reactor.test.StepVerifier
|
||||
import java.time.Duration
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
/**
|
||||
* Kotlin tests for [ReactiveAdapterRegistry].
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
@OptIn(DelicateCoroutinesApi::class)
|
||||
class KotlinReactiveAdapterRegistryTests {
|
||||
class ReactiveAdapterRegistryKotlinTests {
|
||||
|
||||
private val registry = ReactiveAdapterRegistry.getSharedInstance()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
@Disabled
|
||||
class KotlinPropertyResolverExtensionsTests {
|
||||
class PropertyResolverExtensionsKotlinTests {
|
||||
|
||||
val propertyResolver = mockk<PropertyResolver>()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,12 +22,12 @@ import org.junit.jupiter.api.Test
|
||||
import org.springframework.core.io.support.SpringFactoriesLoader.ArgumentResolver
|
||||
|
||||
/**
|
||||
* Kotlin tests for {@link SpringFactoriesLoader}.
|
||||
* Kotlin tests for [SpringFactoriesLoader].
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
@Suppress("unused", "UNUSED_PARAMETER", "PLATFORM_CLASS_MAPPED_TO_KOTLIN")
|
||||
class KotlinSpringFactoriesLoaderTests {
|
||||
@Suppress("unused", "PLATFORM_CLASS_MAPPED_TO_KOTLIN")
|
||||
class SpringFactoriesLoaderKotlinTests {
|
||||
|
||||
@Test
|
||||
fun `Instantiate immutable data class`() {
|
||||
Reference in New Issue
Block a user