diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index e5808d02d78..5da897d2325 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -955,7 +955,7 @@ bom { ] } } - library("Mockito", "4.11.0") { + library("Mockito", "5.3.0") { group("org.mockito") { imports = [ "mockito-bom" diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/DefaultRestartInitializerTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/DefaultRestartInitializerTests.java index df9812de38a..eec932f3588 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/DefaultRestartInitializerTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/DefaultRestartInitializerTests.java @@ -103,7 +103,7 @@ class DefaultRestartInitializerTests { DefaultRestartInitializer initializer = new DefaultRestartInitializer(); ClassLoader classLoader = new MockAppClassLoader(getClass().getClassLoader()); Thread thread = mock(Thread.class); - thread.setName("main"); + given(thread.getName()).willReturn("main"); StackTraceElement element = new StackTraceElement(s, "someMethod", "someFile", 123); given(thread.getStackTrace()).willReturn(new StackTraceElement[] { element }); given(thread.getContextClassLoader()).willReturn(classLoader);