Bump Spring Boot to version 3.5.0

This commit is contained in:
Erik C. Thauvin 2025-05-23 13:39:41 -07:00
parent e6f3fdc984
commit 22a4c53d66
Signed by: erik
GPG key ID: 776702A6A2DA330E
4 changed files with 29 additions and 20 deletions

View file

@ -61,7 +61,7 @@ Don't forget to include the _Spring Boot Loader_ dependency to your project:
```java ```java
scope(standalone) 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) Please check the [BootJarOperation documentation](https://rife2.github.io/bld-spring-boot/rife/bld/extension/BootJarOperation.html#method-summary)

View file

@ -26,7 +26,7 @@ public class DemoApplicationBuild extends WebProject {
repositories = List.of(MAVEN_CENTRAL); repositories = List.of(MAVEN_CENTRAL);
var boot = version(3, 4, 6); var boot = version(3, 5, 0);
scope(compile) scope(compile)
.include(dependency("org.springframework.boot", "spring-boot-starter", boot)) .include(dependency("org.springframework.boot", "spring-boot-starter", boot))
.include(dependency("org.springframework.boot", "spring-boot-starter-actuator", boot)) .include(dependency("org.springframework.boot", "spring-boot-starter-actuator", boot))

View file

@ -37,9 +37,9 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode; import static org.assertj.core.api.Assertions.assertThatCode;
@SuppressWarnings("PMD.AvoidDuplicateLiterals") @SuppressWarnings("PMD.AvoidDuplicateLiterals")
class BootOperationTest { class BootOperationTests {
private static final String BLD = "bld-2.2.1.jar"; 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_COMPILE = "examples/lib/compile/";
private static final String EXAMPLES_LIB_RUNTIME = "examples/lib/runtime/"; private static final String EXAMPLES_LIB_RUNTIME = "examples/lib/runtime/";
private static final String EXAMPLES_LIB_STANDALONE = "examples/lib/standalone/"; private static final String EXAMPLES_LIB_STANDALONE = "examples/lib/standalone/";
@ -192,6 +192,14 @@ class BootOperationTest {
@Nested @Nested
@DisplayName("Errors Tests") @DisplayName("Errors Tests")
class ErrorsTests { class ErrorsTests {
@Test
void invalidMainClass() {
var bootWar = new BootWarOperation().mainClass(MAIN_CLASS);
assertThatCode(bootWar::execute)
.isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining("class required");
}
@Test @Test
void launcherClass() throws IOException { void launcherClass() throws IOException {
var bootWar = new BootJarOperation().mainClass(MAIN_CLASS) var bootWar = new BootJarOperation().mainClass(MAIN_CLASS)
@ -202,17 +210,20 @@ class BootOperationTest {
@Test @Test
void misingLauncherLibs() { void misingLauncherLibs() {
assertThatCode(() -> new BootWarOperation().launcherLibs(new File("foo")))
.as("foo")
.isInstanceOf(IOException.class)
.hasMessageContaining("not found");
assertThatCode(() -> new BootWarOperation().launcherLibs("bar")) assertThatCode(() -> new BootWarOperation().launcherLibs("bar"))
.as("bar") .as("bar")
.isInstanceOf(IOException.class) .isInstanceOf(IOException.class)
.hasMessageContaining("not found"); .hasMessageContaining("not found");
} }
@Test
void misingLauncherLibsAsFile() {
assertThatCode(() -> new BootWarOperation().launcherLibs(new File("foo")))
.as("foo")
.isInstanceOf(IOException.class)
.hasMessageContaining("not found");
}
@Test @Test
void missingLauncherClass() throws IOException { void missingLauncherClass() throws IOException {
var bootWar = new BootWarOperation().mainClass(MAIN_CLASS) var bootWar = new BootWarOperation().mainClass(MAIN_CLASS)
@ -223,15 +234,10 @@ class BootOperationTest {
} }
@Test @Test
void missingOrInvalidMainClass() { void missingMainClass() {
var bootWar = new BootWarOperation(); var bootWar = new BootWarOperation();
assertThatCode(bootWar::execute).isInstanceOf(IllegalArgumentException.class) assertThatCode(bootWar::execute).isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining("mainClass"); .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().clear();
op.launcherLibs(launcher.toPath()); op.launcherLibs(launcher.toPath());
assertThat(op.launcherLibs()).as("Path...").containsExactly(launcher); 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 @Test
@ -334,6 +336,13 @@ class BootOperationTest {
op.launcherLibs(EXAMPLES_LIB_STANDALONE + SPRING_BOOT_LOADER); op.launcherLibs(EXAMPLES_LIB_STANDALONE + SPRING_BOOT_LOADER);
assertThat(op.launcherLibs()).as("String...").containsExactly(launcher); 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 @Nested

View file

@ -30,7 +30,7 @@ import java.nio.file.Files;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
class BootUtilsTest { class BootUtilsTests {
@Nested @Nested
@DisplayName("FileSize Tests") @DisplayName("FileSize Tests")
class FileSizeTests { class FileSizeTests {