Skip to content

Commit

Permalink
Test changing registered variable type for SpelCompilerMode.IMMEDIATE…
Browse files Browse the repository at this point in the history
… also
  • Loading branch information
quaff committed Jul 17, 2024
1 parent ec383f6 commit c649c82
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

import org.junit.jupiter.api.Test;

import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
import org.springframework.core.Ordered;
import org.springframework.expression.Expression;
import org.springframework.expression.spel.SpelCompilerMode;
Expand All @@ -35,6 +37,7 @@
*
* @author Sam Brannen
* @author Andy Clement
* @author Yanming Zhou
* @since 5.1.14
* @see org.springframework.expression.spel.SpelCompilationCoverageTests
*/
Expand Down Expand Up @@ -77,9 +80,10 @@ void defaultMethodInvocation() {
assertThat(expression.getValue(context)).asInstanceOf(BOOLEAN).isTrue();
}

@Test // gh-28043
void changingRegisteredVariableTypeDoesNotResultInFailureInMixedMode() {
SpelParserConfiguration config = new SpelParserConfiguration(SpelCompilerMode.MIXED, null);
@ParameterizedTest // gh-28043
@EnumSource(SpelCompilerMode.class)
void changingRegisteredVariableTypeDoesNotResultInFailure(SpelCompilerMode mode) {
SpelParserConfiguration config = new SpelParserConfiguration(mode, null);
SpelExpressionParser parser = new SpelExpressionParser(config);
Expression sharedExpression = parser.parseExpression("#bean.value");
StandardEvaluationContext context = new StandardEvaluationContext();
Expand Down

0 comments on commit c649c82

Please sign in to comment.