diff --git a/src/test/java/org/apache/ibatis/scripting/xmltags/OgnlCacheTest.java b/src/test/java/org/apache/ibatis/scripting/xmltags/OgnlCacheTest.java index 61851b2cdc6..f0249e61933 100644 --- a/src/test/java/org/apache/ibatis/scripting/xmltags/OgnlCacheTest.java +++ b/src/test/java/org/apache/ibatis/scripting/xmltags/OgnlCacheTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2021 the original author or authors. + * Copyright 2009-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,4 +50,12 @@ class DataClass { } executor.shutdown(); } + + @Test + void issue2609() throws Exception { + Map context = new HashMap<>(); + context.put("d1", java.sql.Date.valueOf("2022-01-01")); + context.put("d2", java.sql.Date.valueOf("2022-01-02")); + assertEquals(-1, OgnlCache.getValue("d1.compareTo(d2)", context)); + } }