3 changed files with 49 additions and 7 deletions
@ -1,5 +1,9 @@
@@ -1,5 +1,9 @@
|
||||
description = "Spring Expression Language (SpEL)" |
||||
|
||||
apply plugin: "kotlin" |
||||
|
||||
dependencies { |
||||
compile(project(":spring-core")) |
||||
testCompile("org.jetbrains.kotlin:kotlin-reflect") |
||||
testCompile("org.jetbrains.kotlin:kotlin-stdlib") |
||||
} |
||||
|
@ -0,0 +1,28 @@
@@ -0,0 +1,28 @@
|
||||
package org.springframework.expression.spel |
||||
|
||||
import org.assertj.core.api.Assertions.assertThat |
||||
import org.junit.jupiter.api.Test |
||||
import org.springframework.expression.ExpressionParser |
||||
import org.springframework.expression.spel.standard.SpelExpressionParser |
||||
|
||||
class KotlinSpelReproTests { |
||||
|
||||
private val parser: ExpressionParser = SpelExpressionParser() |
||||
|
||||
private val context = TestScenarioCreator.getTestEvaluationContext() |
||||
|
||||
|
||||
@Test |
||||
fun `gh-23812 SpEL cannot invoke Kotlin synthetic classes`() { |
||||
val expr = parser.parseExpression("new org.springframework.expression.spel.KotlinSpelReproTests\$Config().kotlinSupplier().invoke()") |
||||
assertThat(expr.getValue(context)).isEqualTo("test") |
||||
} |
||||
|
||||
class Config { |
||||
|
||||
fun kotlinSupplier(): () -> String { |
||||
return { "test" } |
||||
} |
||||
|
||||
} |
||||
} |
Loading…
Reference in new issue