GH-1015 Fix Kotlin dependencies
GH-1015 Fix Kotlin dependencies
This commit is contained in:
@@ -47,16 +47,6 @@
|
||||
<artifactId>jackson-module-kotlin</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>javax.annotation</groupId>-->
|
||||
<!-- <artifactId>javax.annotation-api</artifactId>-->
|
||||
<!-- <version>1.3.2</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>javax.activation</groupId>-->
|
||||
<!-- <artifactId>javax.activation-api</artifactId>-->
|
||||
<!-- <version>1.2.0</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
@@ -159,15 +149,6 @@
|
||||
<plugin>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<version>1.6.0</version>
|
||||
<configuration>
|
||||
<args>
|
||||
<arg>-Xjsr305=strict</arg>
|
||||
</args>
|
||||
<compilerPlugins>
|
||||
<plugin>spring</plugin>
|
||||
</compilerPlugins>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>compile</id>
|
||||
@@ -181,26 +162,7 @@
|
||||
</sourceDirs>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-compile</id>
|
||||
<goals>
|
||||
<goal>test-compile</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sourceDirs>
|
||||
<sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
|
||||
<sourceDir>${project.basedir}/src/test/java</sourceDir>
|
||||
</sourceDirs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-maven-allopen</artifactId>
|
||||
<version>1.6.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
||||
@@ -64,16 +64,6 @@
|
||||
<plugin>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<version>1.8.10</version>
|
||||
<configuration>
|
||||
<args>
|
||||
<arg>-Xjsr305=strict</arg>
|
||||
</args>
|
||||
<compilerPlugins>
|
||||
<plugin>spring</plugin>
|
||||
</compilerPlugins>
|
||||
<jvmTarget>17</jvmTarget>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>test-compile</id>
|
||||
@@ -85,17 +75,9 @@
|
||||
<sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
|
||||
<sourceDir>${project.basedir}/src/test/java</sourceDir>
|
||||
</sourceDirs>
|
||||
<jvmTarget>17</jvmTarget>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-maven-allopen</artifactId>
|
||||
<version>1.8.10</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
||||
@@ -28,39 +28,39 @@ import java.util.List
|
||||
*/
|
||||
@EnableAutoConfiguration
|
||||
@Configuration
|
||||
class KotlinLambdasConfiguration {
|
||||
open class KotlinLambdasConfiguration {
|
||||
|
||||
@Bean
|
||||
fun uppercase(): Function<String, String> = KotlinComponentFunction()
|
||||
open fun uppercase(): Function<String, String> = KotlinComponentFunction()
|
||||
@Bean
|
||||
fun kotlinFunction(): (String) -> String {
|
||||
open fun kotlinFunction(): (String) -> String {
|
||||
return { it.toUpperCase() }
|
||||
}
|
||||
|
||||
@Bean
|
||||
fun kotlinPojoFunction(): (Person) -> String {
|
||||
open fun kotlinPojoFunction(): (Person) -> String {
|
||||
return { it.name.toString()}
|
||||
}
|
||||
|
||||
@Bean
|
||||
fun kotlinListPojoFunction(): (List<Person>) -> String {
|
||||
open fun kotlinListPojoFunction(): (List<Person>) -> String {
|
||||
return {
|
||||
"List of: " + it.get(0).name
|
||||
}
|
||||
}
|
||||
|
||||
@Bean
|
||||
fun kotlinConsumer(): (String) -> Unit {
|
||||
open fun kotlinConsumer(): (String) -> Unit {
|
||||
return { println(it) }
|
||||
}
|
||||
|
||||
@Bean
|
||||
fun kotlinSupplier(): () -> String {
|
||||
open fun kotlinSupplier(): () -> String {
|
||||
return { "Hello" }
|
||||
}
|
||||
|
||||
@Bean
|
||||
fun javaFunction(): Function<String, String> {
|
||||
open fun javaFunction(): Function<String, String> {
|
||||
return Function { x -> x }
|
||||
}
|
||||
|
||||
|
||||
@@ -32,32 +32,32 @@ import java.util.function.Function
|
||||
*/
|
||||
@EnableAutoConfiguration
|
||||
@Configuration
|
||||
class KotlinSuspendFlowLambdasConfiguration {
|
||||
open class KotlinSuspendFlowLambdasConfiguration {
|
||||
|
||||
@Bean
|
||||
fun kotlinFunction(): suspend (Flow<String>) -> Flow<String> = { flow ->
|
||||
open fun kotlinFunction(): suspend (Flow<String>) -> Flow<String> = { flow ->
|
||||
flow.map { value -> value.toUpperCase() }
|
||||
}
|
||||
|
||||
@Bean
|
||||
fun kotlinPojoFunction(): suspend (Flow<Person>) -> Flow<String> = { flow ->
|
||||
open fun kotlinPojoFunction(): suspend (Flow<Person>) -> Flow<String> = { flow ->
|
||||
flow.map(Person::toString)
|
||||
}
|
||||
|
||||
@Bean
|
||||
fun kotlinConsumer(): suspend (Flow<String>) -> Unit = { flow ->
|
||||
open fun kotlinConsumer(): suspend (Flow<String>) -> Unit = { flow ->
|
||||
flow.collect(::println)
|
||||
}
|
||||
|
||||
@Bean
|
||||
fun kotlinSupplier(): suspend () -> Flow<String> = {
|
||||
open fun kotlinSupplier(): suspend () -> Flow<String> = {
|
||||
flow {
|
||||
emit("Hello")
|
||||
}
|
||||
}
|
||||
|
||||
@Bean
|
||||
fun javaFunction(): Function<Flux<String>, Flux<String>> {
|
||||
open fun javaFunction(): Function<Flux<String>, Flux<String>> {
|
||||
return Function { x -> x }
|
||||
}
|
||||
|
||||
|
||||
@@ -26,20 +26,20 @@ import org.springframework.context.annotation.Configuration
|
||||
*/
|
||||
@EnableAutoConfiguration
|
||||
@Configuration
|
||||
class KotlinSuspendLambdasConfiguration {
|
||||
open class KotlinSuspendLambdasConfiguration {
|
||||
|
||||
@Bean
|
||||
fun kotlinFunction(): suspend (Person) -> String {
|
||||
open fun kotlinFunction(): suspend (Person) -> String {
|
||||
return { it.name.toString()}
|
||||
}
|
||||
|
||||
@Bean
|
||||
fun kotlinConsumer(): suspend (String) -> Unit {
|
||||
open fun kotlinConsumer(): suspend (String) -> Unit {
|
||||
return { println(it) }
|
||||
}
|
||||
|
||||
@Bean
|
||||
fun kotlinSupplier(): suspend () -> String {
|
||||
open fun kotlinSupplier(): suspend () -> String {
|
||||
return { "Hello" }
|
||||
}
|
||||
|
||||
|
||||
@@ -41,12 +41,12 @@ import java.net.URI
|
||||
properties = ["spring.cloud.function.web.path=/functions", "spring.main.web-application-type=reactive"]
|
||||
)
|
||||
@ContextConfiguration(classes = [RestApplication::class, HeadersToMessageSuspendTests.TestConfiguration::class])
|
||||
class HeadersToMessageSuspendTests {
|
||||
open class HeadersToMessageSuspendTests {
|
||||
@Autowired
|
||||
private val rest: TestRestTemplate? = null
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testBodyAndCustomHeaderFromMessagePropagation() {
|
||||
open fun testBodyAndCustomHeaderFromMessagePropagation() {
|
||||
// test POJO paylod
|
||||
var postForEntity = rest!!
|
||||
.exchange(
|
||||
@@ -75,9 +75,9 @@ class HeadersToMessageSuspendTests {
|
||||
|
||||
@EnableAutoConfiguration
|
||||
@org.springframework.boot.test.context.TestConfiguration
|
||||
class TestConfiguration {
|
||||
open class TestConfiguration {
|
||||
@Bean("stringSuspend")
|
||||
fun functiono():suspend (employee: Flow<Message<String>>) -> Flow<Message<String>> = { flow: Flow<Message<String>> ->
|
||||
open fun functiono():suspend (employee: Flow<Message<String>>) -> Flow<Message<String>> = { flow: Flow<Message<String>> ->
|
||||
flow.map { request ->
|
||||
val message =
|
||||
MessageBuilder.withPayload(request.payload)
|
||||
@@ -88,7 +88,7 @@ class HeadersToMessageSuspendTests {
|
||||
}
|
||||
|
||||
@Bean("employeeSuspend")
|
||||
fun function1(): suspend (employee: Flow<Message<Employee>>) -> Flow<Message<Employee>> = { flow ->
|
||||
open fun function1(): suspend (employee: Flow<Message<Employee>>) -> Flow<Message<Employee>> = { flow ->
|
||||
flow.map { request ->
|
||||
val message =
|
||||
MessageBuilder
|
||||
@@ -101,7 +101,7 @@ class HeadersToMessageSuspendTests {
|
||||
}
|
||||
}
|
||||
|
||||
class Employee {
|
||||
open class Employee {
|
||||
var name: String? = null
|
||||
var age = 0
|
||||
}
|
||||
|
||||
@@ -41,12 +41,12 @@ import java.net.URI
|
||||
properties = ["spring.cloud.function.web.path=/functions", "spring.main.web-application-type=reactive"]
|
||||
)
|
||||
@ContextConfiguration(classes = [RestApplication::class, HeadersToMessageTests.TestConfiguration::class])
|
||||
class HeadersToMessageTests {
|
||||
open class HeadersToMessageTests {
|
||||
@Autowired
|
||||
private val rest: TestRestTemplate? = null
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testBodyAndCustomHeaderFromMessagePropagation() {
|
||||
open fun testBodyAndCustomHeaderFromMessagePropagation() {
|
||||
// test POJO paylod
|
||||
var postForEntity = rest!!
|
||||
.exchange(
|
||||
@@ -74,9 +74,9 @@ class HeadersToMessageTests {
|
||||
|
||||
@EnableAutoConfiguration
|
||||
@org.springframework.boot.test.context.TestConfiguration
|
||||
class TestConfiguration {
|
||||
open class TestConfiguration {
|
||||
@Bean("string")
|
||||
fun functiono(): (message: Message<String?>) -> Message<String> = { request: Message<String?> ->
|
||||
open fun functiono(): (message: Message<String?>) -> Message<String?> = { request: Message<String?> ->
|
||||
val message =
|
||||
MessageBuilder.withPayload(request.payload)
|
||||
.setHeader("X-Content-Type", "application/xml")
|
||||
@@ -85,7 +85,7 @@ class HeadersToMessageTests {
|
||||
}
|
||||
|
||||
@Bean("employee")
|
||||
fun function1(): (employee: Message<Employee>) -> Message<Employee> = { request ->
|
||||
open fun function1(): (employee: Message<Employee>) -> Message<Employee> = { request ->
|
||||
val message =
|
||||
MessageBuilder
|
||||
.withPayload(request.payload)
|
||||
@@ -96,7 +96,7 @@ class HeadersToMessageTests {
|
||||
}
|
||||
|
||||
// used by json converter
|
||||
class Employee {
|
||||
open class Employee {
|
||||
var name: String? = null
|
||||
var age = 0
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-maven-allopen</artifactId>
|
||||
<version>1.8.10</version>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
||||
Reference in New Issue
Block a user