From 22a4c53d665d8c568e246a2ccd540e538aa53925 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 23 May 2025 13:39:41 -0700 Subject: [PATCH] Bump Spring Boot to version 3.5.0 --- README.md | 2 +- .../example/demo/DemoApplicationBuild.java | 2 +- ...ationTest.java => BootOperationTests.java} | 43 +++++++++++-------- ...BootUtilsTest.java => BootUtilsTests.java} | 2 +- 4 files changed, 29 insertions(+), 20 deletions(-) rename src/test/java/rife/bld/extension/{BootOperationTest.java => BootOperationTests.java} (98%) rename src/test/java/rife/bld/extension/{BootUtilsTest.java => BootUtilsTests.java} (99%) diff --git a/README.md b/README.md index 9a5ba91..a6fa970 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Don't forget to include the _Spring Boot Loader_ dependency to your project: ```java scope(standalone) - .include(dependency("org.springframework.boot:spring-boot-loader:3.4.6")); + .include(dependency("org.springframework.boot:spring-boot-loader:3.5.0")); ``` Please check the [BootJarOperation documentation](https://rife2.github.io/bld-spring-boot/rife/bld/extension/BootJarOperation.html#method-summary) diff --git a/examples/src/bld/java/com/example/demo/DemoApplicationBuild.java b/examples/src/bld/java/com/example/demo/DemoApplicationBuild.java index db0d8c1..d98bc98 100644 --- a/examples/src/bld/java/com/example/demo/DemoApplicationBuild.java +++ b/examples/src/bld/java/com/example/demo/DemoApplicationBuild.java @@ -26,7 +26,7 @@ public class DemoApplicationBuild extends WebProject { repositories = List.of(MAVEN_CENTRAL); - var boot = version(3, 4, 6); + var boot = version(3, 5, 0); scope(compile) .include(dependency("org.springframework.boot", "spring-boot-starter", boot)) .include(dependency("org.springframework.boot", "spring-boot-starter-actuator", boot)) diff --git a/src/test/java/rife/bld/extension/BootOperationTest.java b/src/test/java/rife/bld/extension/BootOperationTests.java similarity index 98% rename from src/test/java/rife/bld/extension/BootOperationTest.java rename to src/test/java/rife/bld/extension/BootOperationTests.java index b4e73a3..4c324bb 100644 --- a/src/test/java/rife/bld/extension/BootOperationTest.java +++ b/src/test/java/rife/bld/extension/BootOperationTests.java @@ -37,9 +37,9 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatCode; @SuppressWarnings("PMD.AvoidDuplicateLiterals") -class BootOperationTest { +class BootOperationTests { private static final String BLD = "bld-2.2.1.jar"; - private static final String BOOT_VERSION = "3.4.6"; + private static final String BOOT_VERSION = "3.5.0"; private static final String EXAMPLES_LIB_COMPILE = "examples/lib/compile/"; private static final String EXAMPLES_LIB_RUNTIME = "examples/lib/runtime/"; private static final String EXAMPLES_LIB_STANDALONE = "examples/lib/standalone/"; @@ -192,6 +192,14 @@ class BootOperationTest { @Nested @DisplayName("Errors Tests") class ErrorsTests { + @Test + void invalidMainClass() { + var bootWar = new BootWarOperation().mainClass(MAIN_CLASS); + assertThatCode(bootWar::execute) + .isInstanceOf(IllegalArgumentException.class) + .hasMessageContaining("class required"); + } + @Test void launcherClass() throws IOException { var bootWar = new BootJarOperation().mainClass(MAIN_CLASS) @@ -202,17 +210,20 @@ class BootOperationTest { @Test void misingLauncherLibs() { - assertThatCode(() -> new BootWarOperation().launcherLibs(new File("foo"))) - .as("foo") - .isInstanceOf(IOException.class) - .hasMessageContaining("not found"); - assertThatCode(() -> new BootWarOperation().launcherLibs("bar")) .as("bar") .isInstanceOf(IOException.class) .hasMessageContaining("not found"); } + @Test + void misingLauncherLibsAsFile() { + assertThatCode(() -> new BootWarOperation().launcherLibs(new File("foo"))) + .as("foo") + .isInstanceOf(IOException.class) + .hasMessageContaining("not found"); + } + @Test void missingLauncherClass() throws IOException { var bootWar = new BootWarOperation().mainClass(MAIN_CLASS) @@ -223,15 +234,10 @@ class BootOperationTest { } @Test - void missingOrInvalidMainClass() { + void missingMainClass() { var bootWar = new BootWarOperation(); assertThatCode(bootWar::execute).isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("mainClass"); - - bootWar = bootWar.mainClass(MAIN_CLASS); - assertThatCode(bootWar::execute) - .isInstanceOf(IllegalArgumentException.class) - .hasMessageContaining("class required"); } } @@ -315,10 +321,6 @@ class BootOperationTest { op.launcherLibs().clear(); op.launcherLibs(launcher.toPath()); assertThat(op.launcherLibs()).as("Path...").containsExactly(launcher); - - op.launcherLibs().clear(); - op.launcherLibsStrings(List.of(EXAMPLES_LIB_STANDALONE + SPRING_BOOT_LOADER)); - assertThat(op.launcherLibs()).as("List(String...)").containsExactly(launcher); } @Test @@ -334,6 +336,13 @@ class BootOperationTest { op.launcherLibs(EXAMPLES_LIB_STANDALONE + SPRING_BOOT_LOADER); assertThat(op.launcherLibs()).as("String...").containsExactly(launcher); } + + @Test + void launcherLibsAsStringList() throws IOException { + op.launcherLibs().clear(); + op.launcherLibsStrings(List.of(EXAMPLES_LIB_STANDALONE + SPRING_BOOT_LOADER)); + assertThat(op.launcherLibs()).as("List(String...)").containsExactly(launcher); + } } @Nested diff --git a/src/test/java/rife/bld/extension/BootUtilsTest.java b/src/test/java/rife/bld/extension/BootUtilsTests.java similarity index 99% rename from src/test/java/rife/bld/extension/BootUtilsTest.java rename to src/test/java/rife/bld/extension/BootUtilsTests.java index bbd8620..052d284 100644 --- a/src/test/java/rife/bld/extension/BootUtilsTest.java +++ b/src/test/java/rife/bld/extension/BootUtilsTests.java @@ -30,7 +30,7 @@ import java.nio.file.Files; import static org.junit.jupiter.api.Assertions.*; -class BootUtilsTest { +class BootUtilsTests { @Nested @DisplayName("FileSize Tests") class FileSizeTests {