From 119209d1adb5a801bf98da78228fdb7d3eb92ec0 Mon Sep 17 00:00:00 2001 From: Jiandong Date: Mon, 28 Apr 2025 23:55:01 +0800 Subject: [PATCH] Fix exception message for `JpaExecutor.doPoll()` Signed-off-by: Jiandong Ma [artem.bilan@broadcom.com Improve commit message] Fixes: #9997 The `nativeQuery` has to be mention in the possible required options to configure. **Auto-cherry-pick to `6.4.x` & `6.3.x`** --- .../org/springframework/integration/jpa/core/JpaExecutor.java | 4 ++-- .../integration/jpa/core/JpaExecutorTests.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaExecutor.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaExecutor.java index a42f01ad34..0b96c8189a 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaExecutor.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/core/JpaExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2025 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. @@ -569,7 +569,7 @@ public class JpaExecutor implements InitializingBean, BeanFactoryAware { else { throw new IllegalStateException("For the polling operation, one of " + "the following properties must be specified: " - + "query, namedQuery or entityClass."); + + "jpaQuery, nativeQuery, namedQuery or entityClass."); } return payload; } diff --git a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/core/JpaExecutorTests.java b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/core/JpaExecutorTests.java index e170d42d58..c310d2836c 100644 --- a/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/core/JpaExecutorTests.java +++ b/spring-integration-jpa/src/test/java/org/springframework/integration/jpa/core/JpaExecutorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2025 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. @@ -75,7 +75,7 @@ public class JpaExecutorTests { .isThrownBy(jpaExecutor::poll) .withMessage("For the polling operation, one of " + "the following properties must be specified: " - + "query, namedQuery or entityClass."); + + "jpaQuery, nativeQuery, namedQuery or entityClass."); } @Test