From 0fce70da1de50dcf36f2cdb5f0d905fe5dcbde07 Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Mon, 30 Apr 2018 16:52:33 -0400 Subject: [PATCH] Use 'kotlin-spring' gradle plugin --- build.gradle | 4 +++- .../amqp/rabbit/annotation/EnableRabbitKotlinTests.kt | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 5436ace6..effc13b6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlinVersion = '1.2.40' + ext.kotlinVersion = '1.2.41' repositories { maven { url 'https://repo.spring.io/plugins-release' } } @@ -8,6 +8,7 @@ buildscript { classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.3' classpath 'me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" + classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion" } } @@ -236,6 +237,7 @@ project('spring-rabbit') { description = 'Spring RabbitMQ Support' apply plugin: 'kotlin' + apply plugin: 'kotlin-spring' dependencies { diff --git a/spring-rabbit/src/test/kotlin/org/springframework/amqp/rabbit/annotation/EnableRabbitKotlinTests.kt b/spring-rabbit/src/test/kotlin/org/springframework/amqp/rabbit/annotation/EnableRabbitKotlinTests.kt index 35571880..a122e04b 100644 --- a/spring-rabbit/src/test/kotlin/org/springframework/amqp/rabbit/annotation/EnableRabbitKotlinTests.kt +++ b/spring-rabbit/src/test/kotlin/org/springframework/amqp/rabbit/annotation/EnableRabbitKotlinTests.kt @@ -57,7 +57,7 @@ class EnableRabbitKotlinTests { @Configuration @EnableRabbit - open class Config { + class Config { val latch = CountDownLatch(1) @@ -67,17 +67,18 @@ class EnableRabbitKotlinTests { } @Bean - open fun rabbitListenerContainerFactory(cf: CachingConnectionFactory): SimpleRabbitListenerContainerFactory { + fun rabbitListenerContainerFactory(cf: CachingConnectionFactory): SimpleRabbitListenerContainerFactory { val factory = SimpleRabbitListenerContainerFactory() factory.setConnectionFactory(cf) return factory } @Bean - open fun cf(): CachingConnectionFactory { + fun cf(): CachingConnectionFactory { return CachingConnectionFactory( RabbitAvailableCondition.getBrokerRunning().connectionFactory) } + } }