From 206e68fd6226e092f77dd444c1f88be634800d25 Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Thu, 8 Jun 2023 13:03:55 -0400 Subject: [PATCH] Default Empty Map for PF configurationProperties The default behavior was to throw an `UnsupportedOperationException` which effectively makes the `MockProducerFactory` unusable without subclassing, e.g. in `spring-integration-kafka`, which calls that method to examine some properties. Change the default behavior to return an empty map. --- .../java/org/springframework/kafka/core/ProducerFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-kafka/src/main/java/org/springframework/kafka/core/ProducerFactory.java b/spring-kafka/src/main/java/org/springframework/kafka/core/ProducerFactory.java index b65802ac88..bb3dcdc732 100644 --- a/spring-kafka/src/main/java/org/springframework/kafka/core/ProducerFactory.java +++ b/spring-kafka/src/main/java/org/springframework/kafka/core/ProducerFactory.java @@ -123,7 +123,7 @@ default void reset() { * @since 2.5 */ default Map getConfigurationProperties() { - throw new UnsupportedOperationException("This implementation doesn't support this method"); + return Collections.emptyMap(); } /**