From 0c0e7388d7d5ece4c1b230a2b87e2e887758fbe5 Mon Sep 17 00:00:00 2001 From: exoego Date: Fri, 23 Aug 2024 23:30:38 +0900 Subject: [PATCH] Add org.thymeleaf.engine.IterationStatusVar --- .../thymeleaf/3.1.0.RC1/reflect-config.json | 12 ++++++++++++ .../src/test/java/org/thymeleaf/ThymeleafTest.java | 10 +++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/metadata/org.thymeleaf/thymeleaf/3.1.0.RC1/reflect-config.json b/metadata/org.thymeleaf/thymeleaf/3.1.0.RC1/reflect-config.json index e142f9739..05d297026 100644 --- a/metadata/org.thymeleaf/thymeleaf/3.1.0.RC1/reflect-config.json +++ b/metadata/org.thymeleaf/thymeleaf/3.1.0.RC1/reflect-config.json @@ -404,5 +404,17 @@ "condition": { "typeReachable": "org.thymeleaf.standard.expression.StandardExpressionParser" } + }, + { + "name": "org.thymeleaf.engine.IterationStatusVar", + "allDeclaredConstructors": true, + "allPublicConstructors": true, + "allDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true, + "condition": { + "typeReachable": "org.thymeleaf.standard.expression.OGNLVariableExpressionEvaluator" + } } ] diff --git a/tests/src/org.thymeleaf/thymeleaf/3.1.0.RC1/src/test/java/org/thymeleaf/ThymeleafTest.java b/tests/src/org.thymeleaf/thymeleaf/3.1.0.RC1/src/test/java/org/thymeleaf/ThymeleafTest.java index 5546fb97f..b80548774 100644 --- a/tests/src/org.thymeleaf/thymeleaf/3.1.0.RC1/src/test/java/org/thymeleaf/ThymeleafTest.java +++ b/tests/src/org.thymeleaf/thymeleaf/3.1.0.RC1/src/test/java/org/thymeleaf/ThymeleafTest.java @@ -185,5 +185,13 @@ void renderTemporalsExpression() { assertThat(output).startsWith("

15/06/1981

"); } - + @Test + void renderIteratorStatus() { + TemplateEngine templateEngine = new TemplateEngine(); + Context context = new Context(); + context.setVariable("array", new String[] {"one", "two"}); + String template = ""; + String output = templateEngine.process(template, context); + assertThat(output).startsWith(""); + } }