From bc87b20e4ee1319797233545a02d67eb1f3964de Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Wed, 3 Jul 2024 08:30:47 +0200 Subject: [PATCH] Polish "Automatically add Spring Modulith event externalization dependency" See gh-1528 --- .../SpringModulithBuildCustomizer.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/start-site/src/main/java/io/spring/start/site/extension/dependency/springmodulith/SpringModulithBuildCustomizer.java b/start-site/src/main/java/io/spring/start/site/extension/dependency/springmodulith/SpringModulithBuildCustomizer.java index f01b1a44f9..91604af4cd 100644 --- a/start-site/src/main/java/io/spring/start/site/extension/dependency/springmodulith/SpringModulithBuildCustomizer.java +++ b/start-site/src/main/java/io/spring/start/site/extension/dependency/springmodulith/SpringModulithBuildCustomizer.java @@ -92,17 +92,11 @@ private boolean addEventExternalizationDependency(Build build) { } private String getModulithBrokerKey(String broker) { - - switch (broker) { - case "kafka": - case "amqp": - return broker; - case "artemis": - case "activemq": - return "jms"; - default: - throw new IllegalArgumentException("Unsupported broker!"); - } + return switch (broker) { + case "kafka", "amqp" -> broker; + case "artemis", "activemq" -> "jms"; + default -> throw new IllegalArgumentException("Unsupported broker!"); + }; } }