From 20c84b7650e7183a692e72b1178ccdfe630a6f91 Mon Sep 17 00:00:00 2001 From: Martin Kouba Date: Thu, 26 May 2022 14:05:39 +0200 Subject: [PATCH] QuteProcessor - more compact format to report incorrect expressions - resolves #25724 --- .../qute/deployment/QuteProcessor.java | 32 ++++++++++--------- .../TemplateDataValidationTest.java | 2 +- .../TemplateEnumValidationFailureTest.java | 2 +- ...emplateExtensionValidationFailureTest.java | 6 ++-- .../TemplateGlobalValidationFailureTest.java | 5 ++- ...MessageBundleExpressionValidationTest.java | 2 +- ...undleTemplateExpressionValidationTest.java | 2 +- .../NamedBeanValidationFailureTest.java | 2 +- .../CheckedTemplateRequireTypeSafeTest.java | 2 +- .../InterfaceValidationFailureTest.java | 2 +- .../typesafe/TypeSafeLoopFailureTest.java | 2 +- .../typesafe/ValidationFailuresTest.java | 2 +- .../typesafe/WhenValidationFailureTest.java | 2 +- .../resteasy/deployment/TypeErrorTest.java | 2 +- .../qute/deployment/TypeErrorTest.java | 2 +- .../quarkus/test/qute/QuteErrorPageTest.java | 2 +- 16 files changed, 35 insertions(+), 34 deletions(-) diff --git a/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java b/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java index 10368db18c7a5d..97b34b876f276a 100644 --- a/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java +++ b/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java @@ -177,39 +177,41 @@ void processTemplateErrors(TemplatesAnalysisBuildItem analysis, List { - assertTrue(t.getMessage().contains("Incorrect expression")); + assertTrue(t.getMessage().contains("Found incorrect expressions")); assertTrue(t.getMessage().contains("name.foo()")); }); diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-qute/deployment/src/test/java/io/quarkus/resteasy/reactive/qute/deployment/TypeErrorTest.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-qute/deployment/src/test/java/io/quarkus/resteasy/reactive/qute/deployment/TypeErrorTest.java index cbaf3ab5130245..ac8a13836298f6 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-qute/deployment/src/test/java/io/quarkus/resteasy/reactive/qute/deployment/TypeErrorTest.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-qute/deployment/src/test/java/io/quarkus/resteasy/reactive/qute/deployment/TypeErrorTest.java @@ -20,7 +20,7 @@ public class TypeErrorTest { .addAsResource("templates/HelloResource/typedTemplatePrimitives.txt") .addAsResource(new StringAsset("Hello {name}!"), "templates/hello.txt")) .assertException(t -> { - assertTrue(t.getMessage().contains("Incorrect expression")); + assertTrue(t.getMessage().contains("Found incorrect expressions")); assertTrue(t.getMessage().contains("name.foo()")); }); diff --git a/integration-tests/devmode/src/test/java/io/quarkus/test/qute/QuteErrorPageTest.java b/integration-tests/devmode/src/test/java/io/quarkus/test/qute/QuteErrorPageTest.java index be9814850f204f..effa9b27abe786 100644 --- a/integration-tests/devmode/src/test/java/io/quarkus/test/qute/QuteErrorPageTest.java +++ b/integration-tests/devmode/src/test/java/io/quarkus/test/qute/QuteErrorPageTest.java @@ -22,7 +22,7 @@ public class QuteErrorPageTest { public void testErrorPage() { config.modifyResourceFile("templates/hello.txt", file -> "{@java.lang.String hello}{hello.foo}"); RestAssured.when().get("/hello").then() - .body(containsString("Incorrect expression found: {hello.foo}")) + .body(containsString("hello.txt:1"), containsString("{hello.foo}")) .statusCode(Status.INTERNAL_SERVER_ERROR.getStatusCode()); }