From fb17e283d11e05459d0ab8a3d0332ae07484f0bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Fri, 7 Jul 2023 17:47:01 +0200 Subject: [PATCH 1/2] Replace @link by proper KDoc class reference in tests Closes gh-30836 --- .../kotlin/org/springframework/beans/KotlinBeanUtilsTests.kt | 4 ++-- .../KotlinBeanValidationBeanRegistrationAotProcessorTests.kt | 2 +- .../core/io/support/KotlinSpringFactoriesLoaderTests.kt | 4 ++-- .../annotation/KotlinMessageWriterResultHandlerTests.kt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spring-beans/src/test/kotlin/org/springframework/beans/KotlinBeanUtilsTests.kt b/spring-beans/src/test/kotlin/org/springframework/beans/KotlinBeanUtilsTests.kt index 647d320fad9..a9dc7c5158d 100644 --- a/spring-beans/src/test/kotlin/org/springframework/beans/KotlinBeanUtilsTests.kt +++ b/spring-beans/src/test/kotlin/org/springframework/beans/KotlinBeanUtilsTests.kt @@ -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. @@ -20,7 +20,7 @@ import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test /** - * Kotlin tests for {@link BeanUtils}. + * Kotlin tests for [BeanUtils]. * * @author Sebastien Deleuze */ diff --git a/spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/KotlinBeanValidationBeanRegistrationAotProcessorTests.kt b/spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/KotlinBeanValidationBeanRegistrationAotProcessorTests.kt index 21b26a74d88..8659a30dcd4 100644 --- a/spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/KotlinBeanValidationBeanRegistrationAotProcessorTests.kt +++ b/spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/KotlinBeanValidationBeanRegistrationAotProcessorTests.kt @@ -30,7 +30,7 @@ import org.springframework.beans.factory.support.RootBeanDefinition import org.springframework.validation.beanvalidation.BeanValidationBeanRegistrationAotProcessorTests.* /** - * Kotlin tests for {@link BeanValidationBeanRegistrationAotProcessor}. + * Kotlin tests for [BeanValidationBeanRegistrationAotProcessor]. * * @author Sebastien Deleuze */ diff --git a/spring-core/src/test/kotlin/org/springframework/core/io/support/KotlinSpringFactoriesLoaderTests.kt b/spring-core/src/test/kotlin/org/springframework/core/io/support/KotlinSpringFactoriesLoaderTests.kt index 64e6f99fb05..c06bff9fb36 100644 --- a/spring-core/src/test/kotlin/org/springframework/core/io/support/KotlinSpringFactoriesLoaderTests.kt +++ b/spring-core/src/test/kotlin/org/springframework/core/io/support/KotlinSpringFactoriesLoaderTests.kt @@ -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,7 +22,7 @@ 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 */ diff --git a/spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/method/annotation/KotlinMessageWriterResultHandlerTests.kt b/spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/method/annotation/KotlinMessageWriterResultHandlerTests.kt index 6599d145d9c..7744dda14a2 100644 --- a/spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/method/annotation/KotlinMessageWriterResultHandlerTests.kt +++ b/spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/method/annotation/KotlinMessageWriterResultHandlerTests.kt @@ -40,7 +40,7 @@ import java.time.Duration import java.util.* /** - * Kotlin unit tests for {@link AbstractMessageWriterResultHandler}. + * Kotlin unit tests for [AbstractMessageWriterResultHandler]. * * @author Sebastien Deleuze */ From b3de1b8e9508891b31f25527fc079d7e2dcd7129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Fri, 7 Jul 2023 18:39:02 +0200 Subject: [PATCH 2/2] Use consistently *KotlinTests naming for Kotlin tests Closes gh-30837 --- ...nUtilsTests.kt => BeanUtilsKotlinTests.kt} | 2 +- ...owiredTests.kt => AutowiredKotlinTests.kt} | 4 ++-- ...ts.kt => ConfigurationClassKotlinTests.kt} | 10 ++++++--- ...eanRegistrationAotProcessorKotlinTests.kt} | 2 +- ...ests.kt => MethodValidationKotlinTests.kt} | 2 +- ...ingReflectionHintsRegistrarKotlinTests.kt} | 4 ++-- ....kt => BridgeMethodResolverKotlinTests.kt} | 9 ++++++-- ...sUtilsTests.kt => CoroutinesUtilsTests.kt} | 21 ++++++++++++------- ...aultParameterNameDiscovererKotlinTests.kt} | 4 ++-- ...s.kt => GenericTypeResolverKotlinTests.kt} | 4 ++-- ...nReflectionParameterNameDiscovererTests.kt | 4 ++-- ...Tests.kt => MethodParameterKotlinTests.kt} | 8 +++---- ... => ReactiveAdapterRegistryKotlinTests.kt} | 9 ++++++-- ... PropertyResolverExtensionsKotlinTests.kt} | 4 ++-- ...kt => SpringFactoriesLoaderKotlinTests.kt} | 4 ++-- ...lReproTests.kt => SpelReproKotlinTests.kt} | 4 ++-- ...ts.kt => DataClassRowMapperKotlinTests.kt} | 4 ++-- ...nSerializationJsonMessageConverterTests.kt | 3 +-- ...icPropertySourceKotlinIntegrationTests.kt} | 4 ++-- ...yTests.kt => ResponseEntityKotlinTests.kt} | 2 +- .../KotlinSerializationCborEncoderTests.kt | 3 +-- ...KotlinSerializationProtobufDecoderTests.kt | 6 +++--- ...sts.kt => HttpServiceMethodKotlinTests.kt} | 2 +- ...> WebClientHttpServiceProxyKotlinTests.kt} | 3 +-- ...t => InvocableHandlerMethodKotlinTests.kt} | 7 ++++++- ... MessageWriterResultHandlerKotlinTests.kt} | 2 +- 26 files changed, 76 insertions(+), 55 deletions(-) rename spring-beans/src/test/kotlin/org/springframework/beans/{KotlinBeanUtilsTests.kt => BeanUtilsKotlinTests.kt} (99%) rename spring-beans/src/test/kotlin/org/springframework/beans/factory/annotation/{KotlinAutowiredTests.kt => AutowiredKotlinTests.kt} (99%) rename spring-context/src/test/kotlin/org/springframework/context/annotation/{KotlinConfigurationClassTests.kt => ConfigurationClassKotlinTests.kt} (90%) rename spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/{KotlinBeanValidationBeanRegistrationAotProcessorTests.kt => BeanValidationBeanRegistrationAotProcessorKotlinTests.kt} (98%) rename spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/{KotlinMethodValidationTests.kt => MethodValidationKotlinTests.kt} (98%) rename spring-core/src/test/kotlin/org/springframework/aot/hint/{KotlinBindingReflectionHintsRegistrarTests.kt => BindingReflectionHintsRegistrarKotlinTests.kt} (97%) rename spring-core/src/test/kotlin/org/springframework/core/{KotlinBridgeMethodResolverTests.kt => BridgeMethodResolverKotlinTests.kt} (92%) rename spring-core/src/test/kotlin/org/springframework/core/{KotlinCoroutinesUtilsTests.kt => CoroutinesUtilsTests.kt} (79%) rename spring-core/src/test/kotlin/org/springframework/core/{KotlinDefaultParameterNameDiscovererTests.kt => DefaultParameterNameDiscovererKotlinTests.kt} (90%) rename spring-core/src/test/kotlin/org/springframework/core/{KotlinGenericTypeResolverTests.kt => GenericTypeResolverKotlinTests.kt} (95%) rename spring-core/src/test/kotlin/org/springframework/core/{KotlinMethodParameterTests.kt => MethodParameterKotlinTests.kt} (97%) rename spring-core/src/test/kotlin/org/springframework/core/{KotlinReactiveAdapterRegistryTests.kt => ReactiveAdapterRegistryKotlinTests.kt} (93%) rename spring-core/src/test/kotlin/org/springframework/core/env/{KotlinPropertyResolverExtensionsTests.kt => PropertyResolverExtensionsKotlinTests.kt} (94%) rename spring-core/src/test/kotlin/org/springframework/core/io/support/{KotlinSpringFactoriesLoaderTests.kt => SpringFactoriesLoaderKotlinTests.kt} (97%) rename spring-expression/src/test/kotlin/org/springframework/expression/spel/{KotlinSpelReproTests.kt => SpelReproKotlinTests.kt} (96%) rename spring-jdbc/src/test/kotlin/org/springframework/jdbc/core/{KotlinDataClassRowMapperTests.kt => DataClassRowMapperKotlinTests.kt} (93%) rename spring-test/src/test/kotlin/org/springframework/test/context/{KotlinDynamicPropertySourceIntegrationTests.kt => DynamicPropertySourceKotlinIntegrationTests.kt} (94%) rename spring-web/src/test/kotlin/org/springframework/http/{KotlinResponseEntityTests.kt => ResponseEntityKotlinTests.kt} (97%) rename spring-web/src/test/kotlin/org/springframework/web/service/invoker/{KotlinHttpServiceMethodTests.kt => HttpServiceMethodKotlinTests.kt} (98%) rename spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/client/support/{KotlinWebClientHttpServiceProxyTests.kt => WebClientHttpServiceProxyKotlinTests.kt} (98%) rename spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/{KotlinInvocableHandlerMethodTests.kt => InvocableHandlerMethodKotlinTests.kt} (97%) rename spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/method/annotation/{KotlinMessageWriterResultHandlerTests.kt => MessageWriterResultHandlerKotlinTests.kt} (99%) diff --git a/spring-beans/src/test/kotlin/org/springframework/beans/KotlinBeanUtilsTests.kt b/spring-beans/src/test/kotlin/org/springframework/beans/BeanUtilsKotlinTests.kt similarity index 99% rename from spring-beans/src/test/kotlin/org/springframework/beans/KotlinBeanUtilsTests.kt rename to spring-beans/src/test/kotlin/org/springframework/beans/BeanUtilsKotlinTests.kt index a9dc7c5158d..40ba3cdbf5e 100644 --- a/spring-beans/src/test/kotlin/org/springframework/beans/KotlinBeanUtilsTests.kt +++ b/spring-beans/src/test/kotlin/org/springframework/beans/BeanUtilsKotlinTests.kt @@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test * @author Sebastien Deleuze */ @Suppress("unused", "UNUSED_PARAMETER") -class KotlinBeanUtilsTests { +class BeanUtilsKotlinTests { @Test fun `Instantiate immutable class`() { diff --git a/spring-beans/src/test/kotlin/org/springframework/beans/factory/annotation/KotlinAutowiredTests.kt b/spring-beans/src/test/kotlin/org/springframework/beans/factory/annotation/AutowiredKotlinTests.kt similarity index 99% rename from spring-beans/src/test/kotlin/org/springframework/beans/factory/annotation/KotlinAutowiredTests.kt rename to spring-beans/src/test/kotlin/org/springframework/beans/factory/annotation/AutowiredKotlinTests.kt index 37d6793cad5..3058ecea028 100644 --- a/spring-beans/src/test/kotlin/org/springframework/beans/factory/annotation/KotlinAutowiredTests.kt +++ b/spring-beans/src/test/kotlin/org/springframework/beans/factory/annotation/AutowiredKotlinTests.kt @@ -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. @@ -31,7 +31,7 @@ import org.springframework.beans.testfixture.beans.TestBean * @author Juergen Hoeller * @author Sebastien Deleuze */ -class KotlinAutowiredTests { +class AutowiredKotlinTests { @Test fun `Autowiring with target`() { diff --git a/spring-context/src/test/kotlin/org/springframework/context/annotation/KotlinConfigurationClassTests.kt b/spring-context/src/test/kotlin/org/springframework/context/annotation/ConfigurationClassKotlinTests.kt similarity index 90% rename from spring-context/src/test/kotlin/org/springframework/context/annotation/KotlinConfigurationClassTests.kt rename to spring-context/src/test/kotlin/org/springframework/context/annotation/ConfigurationClassKotlinTests.kt index 72d411e06b9..a12e9d74791 100644 --- a/spring-context/src/test/kotlin/org/springframework/context/annotation/KotlinConfigurationClassTests.kt +++ b/spring-context/src/test/kotlin/org/springframework/context/annotation/ConfigurationClassKotlinTests.kt @@ -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. @@ -16,14 +16,18 @@ package org.springframework.context.annotation - import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatExceptionOfType import org.junit.jupiter.api.Test import org.springframework.beans.factory.getBean import org.springframework.beans.factory.parsing.BeanDefinitionParsingException -class KotlinConfigurationClassTests { +/** + * Integration tests for Kotlin configuration classes. + * + * @author Sebastien Deleuze + */ +class ConfigurationClassKotlinTests { @Test fun `Final configuration with default proxyBeanMethods value`() { diff --git a/spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/KotlinBeanValidationBeanRegistrationAotProcessorTests.kt b/spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/BeanValidationBeanRegistrationAotProcessorKotlinTests.kt similarity index 98% rename from spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/KotlinBeanValidationBeanRegistrationAotProcessorTests.kt rename to spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/BeanValidationBeanRegistrationAotProcessorKotlinTests.kt index 8659a30dcd4..c0f063ec3c6 100644 --- a/spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/KotlinBeanValidationBeanRegistrationAotProcessorTests.kt +++ b/spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/BeanValidationBeanRegistrationAotProcessorKotlinTests.kt @@ -34,7 +34,7 @@ import org.springframework.validation.beanvalidation.BeanValidationBeanRegistrat * * @author Sebastien Deleuze */ -class KotlinBeanValidationBeanRegistrationAotProcessorTests { +class BeanValidationBeanRegistrationAotProcessorKotlinTests { private val processor = BeanValidationBeanRegistrationAotProcessor() diff --git a/spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/KotlinMethodValidationTests.kt b/spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/MethodValidationKotlinTests.kt similarity index 98% rename from spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/KotlinMethodValidationTests.kt rename to spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/MethodValidationKotlinTests.kt index 17991c97f2f..b32199e71ed 100644 --- a/spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/KotlinMethodValidationTests.kt +++ b/spring-context/src/test/kotlin/org/springframework/validation/beanvalidation/MethodValidationKotlinTests.kt @@ -32,7 +32,7 @@ import org.springframework.validation.annotation.Validated * @author Sebastien Deleuze */ @Suppress("UsePropertyAccessSyntax") -class KotlinMethodValidationTests { +class MethodValidationKotlinTests { @Test fun parameterValidation() { diff --git a/spring-core/src/test/kotlin/org/springframework/aot/hint/KotlinBindingReflectionHintsRegistrarTests.kt b/spring-core/src/test/kotlin/org/springframework/aot/hint/BindingReflectionHintsRegistrarKotlinTests.kt similarity index 97% rename from spring-core/src/test/kotlin/org/springframework/aot/hint/KotlinBindingReflectionHintsRegistrarTests.kt rename to spring-core/src/test/kotlin/org/springframework/aot/hint/BindingReflectionHintsRegistrarKotlinTests.kt index f4d0ff82561..b8e93818673 100644 --- a/spring-core/src/test/kotlin/org/springframework/aot/hint/KotlinBindingReflectionHintsRegistrarTests.kt +++ b/spring-core/src/test/kotlin/org/springframework/aot/hint/BindingReflectionHintsRegistrarKotlinTests.kt @@ -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() diff --git a/spring-core/src/test/kotlin/org/springframework/core/KotlinBridgeMethodResolverTests.kt b/spring-core/src/test/kotlin/org/springframework/core/BridgeMethodResolverKotlinTests.kt similarity index 92% rename from spring-core/src/test/kotlin/org/springframework/core/KotlinBridgeMethodResolverTests.kt rename to spring-core/src/test/kotlin/org/springframework/core/BridgeMethodResolverKotlinTests.kt index 5d4303ab786..bb94dd3867f 100644 --- a/spring-core/src/test/kotlin/org/springframework/core/KotlinBridgeMethodResolverTests.kt +++ b/spring-core/src/test/kotlin/org/springframework/core/BridgeMethodResolverKotlinTests.kt @@ -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() { diff --git a/spring-core/src/test/kotlin/org/springframework/core/KotlinCoroutinesUtilsTests.kt b/spring-core/src/test/kotlin/org/springframework/core/CoroutinesUtilsTests.kt similarity index 79% rename from spring-core/src/test/kotlin/org/springframework/core/KotlinCoroutinesUtilsTests.kt rename to spring-core/src/test/kotlin/org/springframework/core/CoroutinesUtilsTests.kt index e43285f9b18..ad7e4ac5d85 100644 --- a/spring-core/src/test/kotlin/org/springframework/core/KotlinCoroutinesUtilsTests.kt +++ b/spring-core/src/test/kotlin/org/springframework/core/CoroutinesUtilsTests.kt @@ -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") } } diff --git a/spring-core/src/test/kotlin/org/springframework/core/KotlinDefaultParameterNameDiscovererTests.kt b/spring-core/src/test/kotlin/org/springframework/core/DefaultParameterNameDiscovererKotlinTests.kt similarity index 90% rename from spring-core/src/test/kotlin/org/springframework/core/KotlinDefaultParameterNameDiscovererTests.kt rename to spring-core/src/test/kotlin/org/springframework/core/DefaultParameterNameDiscovererKotlinTests.kt index 7fe1992484f..f5fda6eb741 100644 --- a/spring-core/src/test/kotlin/org/springframework/core/KotlinDefaultParameterNameDiscovererTests.kt +++ b/spring-core/src/test/kotlin/org/springframework/core/DefaultParameterNameDiscovererKotlinTests.kt @@ -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. @@ -19,7 +19,7 @@ package org.springframework.core import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -class KotlinDefaultParameterNameDiscovererTests { +class DefaultParameterNameDiscovererKotlinTests { private val parameterNameDiscoverer = DefaultParameterNameDiscoverer() diff --git a/spring-core/src/test/kotlin/org/springframework/core/KotlinGenericTypeResolverTests.kt b/spring-core/src/test/kotlin/org/springframework/core/GenericTypeResolverKotlinTests.kt similarity index 95% rename from spring-core/src/test/kotlin/org/springframework/core/KotlinGenericTypeResolverTests.kt rename to spring-core/src/test/kotlin/org/springframework/core/GenericTypeResolverKotlinTests.kt index 9780a4f7573..99ccec1672d 100644 --- a/spring-core/src/test/kotlin/org/springframework/core/KotlinGenericTypeResolverTests.kt +++ b/spring-core/src/test/kotlin/org/springframework/core/GenericTypeResolverKotlinTests.kt @@ -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() { diff --git a/spring-core/src/test/kotlin/org/springframework/core/KotlinReflectionParameterNameDiscovererTests.kt b/spring-core/src/test/kotlin/org/springframework/core/KotlinReflectionParameterNameDiscovererTests.kt index 55b5ed47729..4c01bbdb916 100644 --- a/spring-core/src/test/kotlin/org/springframework/core/KotlinReflectionParameterNameDiscovererTests.kt +++ b/spring-core/src/test/kotlin/org/springframework/core/KotlinReflectionParameterNameDiscovererTests.kt @@ -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. @@ -22,7 +22,7 @@ import org.junit.jupiter.api.Test import org.springframework.util.ReflectionUtils /** - * Tests for KotlinReflectionParameterNameDiscoverer + * Tests for [KotlinReflectionParameterNameDiscoverer]. */ class KotlinReflectionParameterNameDiscovererTests { diff --git a/spring-core/src/test/kotlin/org/springframework/core/KotlinMethodParameterTests.kt b/spring-core/src/test/kotlin/org/springframework/core/MethodParameterKotlinTests.kt similarity index 97% rename from spring-core/src/test/kotlin/org/springframework/core/KotlinMethodParameterTests.kt rename to spring-core/src/test/kotlin/org/springframework/core/MethodParameterKotlinTests.kt index 419698d2ff6..040b294d173 100644 --- a/spring-core/src/test/kotlin/org/springframework/core/KotlinMethodParameterTests.kt +++ b/spring-core/src/test/kotlin/org/springframework/core/MethodParameterKotlinTests.kt @@ -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. @@ -32,16 +32,16 @@ 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) private val nonNullableMethod = javaClass.getMethod("nonNullable", 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) diff --git a/spring-core/src/test/kotlin/org/springframework/core/KotlinReactiveAdapterRegistryTests.kt b/spring-core/src/test/kotlin/org/springframework/core/ReactiveAdapterRegistryKotlinTests.kt similarity index 93% rename from spring-core/src/test/kotlin/org/springframework/core/KotlinReactiveAdapterRegistryTests.kt rename to spring-core/src/test/kotlin/org/springframework/core/ReactiveAdapterRegistryKotlinTests.kt index d74b6e20e7d..b8a6defc15c 100644 --- a/spring-core/src/test/kotlin/org/springframework/core/KotlinReactiveAdapterRegistryTests.kt +++ b/spring-core/src/test/kotlin/org/springframework/core/ReactiveAdapterRegistryKotlinTests.kt @@ -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() diff --git a/spring-core/src/test/kotlin/org/springframework/core/env/KotlinPropertyResolverExtensionsTests.kt b/spring-core/src/test/kotlin/org/springframework/core/env/PropertyResolverExtensionsKotlinTests.kt similarity index 94% rename from spring-core/src/test/kotlin/org/springframework/core/env/KotlinPropertyResolverExtensionsTests.kt rename to spring-core/src/test/kotlin/org/springframework/core/env/PropertyResolverExtensionsKotlinTests.kt index 81534cab4c1..776a3d6cf07 100644 --- a/spring-core/src/test/kotlin/org/springframework/core/env/KotlinPropertyResolverExtensionsTests.kt +++ b/spring-core/src/test/kotlin/org/springframework/core/env/PropertyResolverExtensionsKotlinTests.kt @@ -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() diff --git a/spring-core/src/test/kotlin/org/springframework/core/io/support/KotlinSpringFactoriesLoaderTests.kt b/spring-core/src/test/kotlin/org/springframework/core/io/support/SpringFactoriesLoaderKotlinTests.kt similarity index 97% rename from spring-core/src/test/kotlin/org/springframework/core/io/support/KotlinSpringFactoriesLoaderTests.kt rename to spring-core/src/test/kotlin/org/springframework/core/io/support/SpringFactoriesLoaderKotlinTests.kt index c06bff9fb36..06380707614 100644 --- a/spring-core/src/test/kotlin/org/springframework/core/io/support/KotlinSpringFactoriesLoaderTests.kt +++ b/spring-core/src/test/kotlin/org/springframework/core/io/support/SpringFactoriesLoaderKotlinTests.kt @@ -26,8 +26,8 @@ import org.springframework.core.io.support.SpringFactoriesLoader.ArgumentResolve * * @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`() { diff --git a/spring-expression/src/test/kotlin/org/springframework/expression/spel/KotlinSpelReproTests.kt b/spring-expression/src/test/kotlin/org/springframework/expression/spel/SpelReproKotlinTests.kt similarity index 96% rename from spring-expression/src/test/kotlin/org/springframework/expression/spel/KotlinSpelReproTests.kt rename to spring-expression/src/test/kotlin/org/springframework/expression/spel/SpelReproKotlinTests.kt index a15128816d2..65260a1ef41 100644 --- a/spring-expression/src/test/kotlin/org/springframework/expression/spel/KotlinSpelReproTests.kt +++ b/spring-expression/src/test/kotlin/org/springframework/expression/spel/SpelReproKotlinTests.kt @@ -22,7 +22,7 @@ import org.springframework.expression.ExpressionParser import org.springframework.expression.spel.standard.SpelExpressionParser import kotlin.coroutines.Continuation -class KotlinSpelReproTests { +class SpelReproKotlinTests { private val parser: ExpressionParser = SpelExpressionParser() @@ -31,7 +31,7 @@ class KotlinSpelReproTests { @Test fun `gh-23812 SpEL cannot invoke Kotlin synthetic classes`() { - val expr = parser.parseExpression("new org.springframework.expression.spel.KotlinSpelReproTests\$Config().kotlinSupplier().invoke()") + val expr = parser.parseExpression("new org.springframework.expression.spel.SpelReproKotlinTests\$Config().kotlinSupplier().invoke()") assertThat(expr.getValue(context)).isEqualTo("test") } diff --git a/spring-jdbc/src/test/kotlin/org/springframework/jdbc/core/KotlinDataClassRowMapperTests.kt b/spring-jdbc/src/test/kotlin/org/springframework/jdbc/core/DataClassRowMapperKotlinTests.kt similarity index 93% rename from spring-jdbc/src/test/kotlin/org/springframework/jdbc/core/KotlinDataClassRowMapperTests.kt rename to spring-jdbc/src/test/kotlin/org/springframework/jdbc/core/DataClassRowMapperKotlinTests.kt index 81b7ae3a500..d15622ca9fd 100644 --- a/spring-jdbc/src/test/kotlin/org/springframework/jdbc/core/KotlinDataClassRowMapperTests.kt +++ b/spring-jdbc/src/test/kotlin/org/springframework/jdbc/core/DataClassRowMapperKotlinTests.kt @@ -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,7 +22,7 @@ import org.springframework.jdbc.core.test.ConstructorPerson import java.math.BigDecimal import java.util.* -class KotlinDataClassRowMapperTests : AbstractRowMapperTests() { +class DataClassRowMapperKotlinTests : AbstractRowMapperTests() { @Test fun testStaticQueryWithDataClass() { diff --git a/spring-messaging/src/test/kotlin/org/springframework/messaging/converter/KotlinSerializationJsonMessageConverterTests.kt b/spring-messaging/src/test/kotlin/org/springframework/messaging/converter/KotlinSerializationJsonMessageConverterTests.kt index 875a50529c5..458e7a79494 100644 --- a/spring-messaging/src/test/kotlin/org/springframework/messaging/converter/KotlinSerializationJsonMessageConverterTests.kt +++ b/spring-messaging/src/test/kotlin/org/springframework/messaging/converter/KotlinSerializationJsonMessageConverterTests.kt @@ -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. @@ -25,7 +25,6 @@ import org.springframework.messaging.support.MessageBuilder import java.nio.charset.StandardCharsets import kotlin.reflect.typeOf -@Suppress("UsePropertyAccessSyntax") class KotlinSerializationJsonMessageConverterTests { private val converter = KotlinSerializationJsonMessageConverter() diff --git a/spring-test/src/test/kotlin/org/springframework/test/context/KotlinDynamicPropertySourceIntegrationTests.kt b/spring-test/src/test/kotlin/org/springframework/test/context/DynamicPropertySourceKotlinIntegrationTests.kt similarity index 94% rename from spring-test/src/test/kotlin/org/springframework/test/context/KotlinDynamicPropertySourceIntegrationTests.kt rename to spring-test/src/test/kotlin/org/springframework/test/context/DynamicPropertySourceKotlinIntegrationTests.kt index 0e972da175f..ee04a0f07e9 100644 --- a/spring-test/src/test/kotlin/org/springframework/test/context/KotlinDynamicPropertySourceIntegrationTests.kt +++ b/spring-test/src/test/kotlin/org/springframework/test/context/DynamicPropertySourceKotlinIntegrationTests.kt @@ -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. @@ -32,7 +32,7 @@ import org.springframework.test.context.junit.jupiter.SpringJUnitConfig * @author Sam Brannen */ @SpringJUnitConfig -class KotlinDynamicPropertySourceIntegrationTests { +class DynamicPropertySourceKotlinIntegrationTests { @Test fun hasInjectedValues(@Autowired service: Service) { diff --git a/spring-web/src/test/kotlin/org/springframework/http/KotlinResponseEntityTests.kt b/spring-web/src/test/kotlin/org/springframework/http/ResponseEntityKotlinTests.kt similarity index 97% rename from spring-web/src/test/kotlin/org/springframework/http/KotlinResponseEntityTests.kt rename to spring-web/src/test/kotlin/org/springframework/http/ResponseEntityKotlinTests.kt index 0658ba24684..dfda75650d3 100644 --- a/spring-web/src/test/kotlin/org/springframework/http/KotlinResponseEntityTests.kt +++ b/spring-web/src/test/kotlin/org/springframework/http/ResponseEntityKotlinTests.kt @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test * * @author Sebastien Deleuze */ -class KotlinResponseEntityTests { +class ResponseEntityKotlinTests { @Test fun ofNullable() { diff --git a/spring-web/src/test/kotlin/org/springframework/http/codec/cbor/KotlinSerializationCborEncoderTests.kt b/spring-web/src/test/kotlin/org/springframework/http/codec/cbor/KotlinSerializationCborEncoderTests.kt index e5e27ce1ad5..b16dc60ba53 100644 --- a/spring-web/src/test/kotlin/org/springframework/http/codec/cbor/KotlinSerializationCborEncoderTests.kt +++ b/spring-web/src/test/kotlin/org/springframework/http/codec/cbor/KotlinSerializationCborEncoderTests.kt @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 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. @@ -40,7 +40,6 @@ import org.springframework.http.codec.ServerSentEvent * @author Sebastien Deleuze * @author Iain Henderson */ -@Suppress("UsePropertyAccessSyntax") @ExperimentalSerializationApi class KotlinSerializationCborEncoderTests : AbstractEncoderTests(KotlinSerializationCborEncoder()) { diff --git a/spring-web/src/test/kotlin/org/springframework/http/codec/protobuf/KotlinSerializationProtobufDecoderTests.kt b/spring-web/src/test/kotlin/org/springframework/http/codec/protobuf/KotlinSerializationProtobufDecoderTests.kt index 7f15d7c000a..146e9752d25 100644 --- a/spring-web/src/test/kotlin/org/springframework/http/codec/protobuf/KotlinSerializationProtobufDecoderTests.kt +++ b/spring-web/src/test/kotlin/org/springframework/http/codec/protobuf/KotlinSerializationProtobufDecoderTests.kt @@ -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. @@ -39,8 +39,8 @@ import reactor.test.StepVerifier.FirstStep * @author Iain Henderson */ @ExperimentalSerializationApi -class KotlinSerializationCborDecoderTests : AbstractDecoderTests(KotlinSerializationProtobufDecoder()) { - @Suppress("UsePropertyAccessSyntax") +class KotlinSerializationProtobufDecoderTests : AbstractDecoderTests(KotlinSerializationProtobufDecoder()) { + @Test override fun canDecode() { for (mimeType in listOf(MediaType.APPLICATION_PROTOBUF, MediaType.APPLICATION_OCTET_STREAM, MediaType("application", "vnd.google.protobuf"))) { diff --git a/spring-web/src/test/kotlin/org/springframework/web/service/invoker/KotlinHttpServiceMethodTests.kt b/spring-web/src/test/kotlin/org/springframework/web/service/invoker/HttpServiceMethodKotlinTests.kt similarity index 98% rename from spring-web/src/test/kotlin/org/springframework/web/service/invoker/KotlinHttpServiceMethodTests.kt rename to spring-web/src/test/kotlin/org/springframework/web/service/invoker/HttpServiceMethodKotlinTests.kt index 3ba9220edf7..1fdb1a092eb 100644 --- a/spring-web/src/test/kotlin/org/springframework/web/service/invoker/KotlinHttpServiceMethodTests.kt +++ b/spring-web/src/test/kotlin/org/springframework/web/service/invoker/HttpServiceMethodKotlinTests.kt @@ -31,7 +31,7 @@ import org.springframework.web.service.annotation.GetExchange * * @author Sebastien Deleuze */ -class KotlinHttpServiceMethodTests { +class HttpServiceMethodKotlinTests { private val client = TestHttpClientAdapter() private val proxyFactory = HttpServiceProxyFactory.builder(client).build() diff --git a/spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/client/support/KotlinWebClientHttpServiceProxyTests.kt b/spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/client/support/WebClientHttpServiceProxyKotlinTests.kt similarity index 98% rename from spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/client/support/KotlinWebClientHttpServiceProxyTests.kt rename to spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/client/support/WebClientHttpServiceProxyKotlinTests.kt index 6be4d626f37..ac9354cc279 100644 --- a/spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/client/support/KotlinWebClientHttpServiceProxyTests.kt +++ b/spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/client/support/WebClientHttpServiceProxyKotlinTests.kt @@ -40,9 +40,8 @@ import java.util.function.Consumer * * @author DongHyeon Kim * @author Sebastien Deleuze - * */ -class KotlinWebClientHttpServiceProxyTests { +class WebClientHttpServiceProxyKotlinTests { private lateinit var server: MockWebServer diff --git a/spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/KotlinInvocableHandlerMethodTests.kt b/spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/InvocableHandlerMethodKotlinTests.kt similarity index 97% rename from spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/KotlinInvocableHandlerMethodTests.kt rename to spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/InvocableHandlerMethodKotlinTests.kt index 1608a908953..430831b63aa 100644 --- a/spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/KotlinInvocableHandlerMethodTests.kt +++ b/spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/InvocableHandlerMethodKotlinTests.kt @@ -37,7 +37,12 @@ import java.lang.reflect.Method import java.time.Duration import kotlin.reflect.jvm.javaMethod -class KotlinInvocableHandlerMethodTests { +/** + * Kotlin unit tests for [InvocableHandlerMethod]. + * + * @author Sebastien Deleuze + */ +class InvocableHandlerMethodKotlinTests { private val exchange = MockServerWebExchange.from(get("http://localhost:8080/path")) diff --git a/spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/method/annotation/KotlinMessageWriterResultHandlerTests.kt b/spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/method/annotation/MessageWriterResultHandlerKotlinTests.kt similarity index 99% rename from spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/method/annotation/KotlinMessageWriterResultHandlerTests.kt rename to spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/method/annotation/MessageWriterResultHandlerKotlinTests.kt index 7744dda14a2..20fc9b112c5 100644 --- a/spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/method/annotation/KotlinMessageWriterResultHandlerTests.kt +++ b/spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/method/annotation/MessageWriterResultHandlerKotlinTests.kt @@ -44,7 +44,7 @@ import java.util.* * * @author Sebastien Deleuze */ -class KotlinMessageWriterResultHandlerTests { +class MessageWriterResultHandlerKotlinTests { private val resultHandler = initResultHandler()