From 3fd89c3ac1e3f8b6c98aae89a3f43afb4f36e976 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Sat, 5 Sep 2020 13:12:19 +0200 Subject: [PATCH] Fix merge result See gh-25706 --- .../spel/standard/SpelCompilerTests.java | 55 ------------------- 1 file changed, 55 deletions(-) diff --git a/spring-expression/src/test/java/org/springframework/expression/spel/standard/SpelCompilerTests.java b/spring-expression/src/test/java/org/springframework/expression/spel/standard/SpelCompilerTests.java index 7c4fc536b6..c230151d56 100644 --- a/spring-expression/src/test/java/org/springframework/expression/spel/standard/SpelCompilerTests.java +++ b/spring-expression/src/test/java/org/springframework/expression/spel/standard/SpelCompilerTests.java @@ -83,61 +83,6 @@ class SpelCompilerTests { return 42; } } - - @Test // gh-25706 - void defaultMethodInvocation() { - SpelParserConfiguration config = new SpelParserConfiguration(SpelCompilerMode.IMMEDIATE, null); - SpelExpressionParser parser = new SpelExpressionParser(config); - - StandardEvaluationContext context = new StandardEvaluationContext(); - Item item = new Item(); - context.setRootObject(item); - - Expression expression = parser.parseExpression("#root.isEditable2()"); - assertThat(SpelCompiler.compile(expression)).isFalse(); - assertThat(expression.getValue(context)).isEqualTo(false); - assertThat(SpelCompiler.compile(expression)).isTrue(); - SpelCompilationCoverageTests.assertIsCompiled(expression); - assertThat(expression.getValue(context)).isEqualTo(false); - - context.setVariable("user", new User()); - expression = parser.parseExpression("#root.isEditable(#user)"); - assertThat(SpelCompiler.compile(expression)).isFalse(); - assertThat(expression.getValue(context)).isEqualTo(true); - assertThat(SpelCompiler.compile(expression)).isTrue(); - SpelCompilationCoverageTests.assertIsCompiled(expression); - assertThat(expression.getValue(context)).isEqualTo(true); - } - - public static class User { - boolean isAdmin() { - return true; - } - } - - public static class Item implements Editable { - // some fields - private String someField = ""; - - // some getters and setters - - @Override - public boolean hasSomeProperty() { - return someField != null; - } - } - - public interface Editable { - default boolean isEditable(User user) { - return user.isAdmin() && hasSomeProperty(); - } - - default boolean isEditable2() { - return false; - } - - boolean hasSomeProperty(); - } public static class User {