From be9ee9112c61b143f8418d4c25cc3f527c5c90a8 Mon Sep 17 00:00:00 2001 From: Stefano Cordio Date: Thu, 4 Jan 2024 09:25:31 +0100 Subject: [PATCH] Upgrade to AssertJ 3.25.1, use AssertJ BOM Closes gh-31945 --- framework-platform/framework-platform.gradle | 2 +- .../beans/factory/config/YamlProcessorTests.java | 4 +--- .../springframework/aot/agent/RecordedInvocationTests.java | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/framework-platform/framework-platform.gradle b/framework-platform/framework-platform.gradle index e03441a25a5..9a4a86f198b 100644 --- a/framework-platform/framework-platform.gradle +++ b/framework-platform/framework-platform.gradle @@ -15,6 +15,7 @@ dependencies { api(platform("io.rsocket:rsocket-bom:1.1.3")) api(platform("org.apache.groovy:groovy-bom:4.0.17")) api(platform("org.apache.logging.log4j:log4j-bom:2.21.1")) + api(platform("org.assertj:assertj-bom:3.25.1")) api(platform("org.eclipse.jetty:jetty-bom:12.0.5")) api(platform("org.eclipse.jetty.ee10:jetty-ee10-bom:12.0.3")) api(platform("org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3")) @@ -109,7 +110,6 @@ dependencies { api("org.aspectj:aspectjrt:1.9.21") api("org.aspectj:aspectjtools:1.9.21") api("org.aspectj:aspectjweaver:1.9.21") - api("org.assertj:assertj-core:3.25.0") api("org.awaitility:awaitility:4.2.0") api("org.bouncycastle:bcpkix-jdk18on:1.72") api("org.codehaus.jettison:jettison:1.5.4") diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/config/YamlProcessorTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/config/YamlProcessorTests.java index 8468a880035..868c1ca2a93 100644 --- a/spring-beans/src/test/java/org/springframework/beans/factory/config/YamlProcessorTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/factory/config/YamlProcessorTests.java @@ -146,9 +146,7 @@ class YamlProcessorTests { void standardTypesSupportedByDefault() { setYaml("value: !!set\n ? first\n ? second"); this.processor.process((properties, map) -> { - // Assert on Properties as a Map due to bug in AssertJ 3.25.0 - Map propsAsMap = new LinkedHashMap<>(properties); - assertThat(propsAsMap).containsExactly(entry("value[0]", "first"), entry("value[1]", "second")); + assertThat(properties).containsExactly(entry("value[0]", "first"), entry("value[1]", "second")); assertThat(map.get("value")).asInstanceOf(InstanceOfAssertFactories.type(Set.class)) .satisfies(set -> assertThat(set).containsExactly("first", "second")); }); diff --git a/spring-core-test/src/test/java/org/springframework/aot/agent/RecordedInvocationTests.java b/spring-core-test/src/test/java/org/springframework/aot/agent/RecordedInvocationTests.java index f0a8c57462b..0a2410a4d7b 100644 --- a/spring-core-test/src/test/java/org/springframework/aot/agent/RecordedInvocationTests.java +++ b/spring-core-test/src/test/java/org/springframework/aot/agent/RecordedInvocationTests.java @@ -19,7 +19,6 @@ package org.springframework.aot.agent; import java.lang.reflect.Method; -import org.assertj.core.api.ThrowableAssert.ThrowingCallableWithValue; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -64,7 +63,7 @@ class RecordedInvocationTests { @Test void staticInvocationShouldThrowWhenGetInstance() { - assertThatThrownBy((ThrowingCallableWithValue) staticInvocation::getInstance).isInstanceOf(IllegalStateException.class); + assertThatThrownBy(staticInvocation::getInstance).isInstanceOf(IllegalStateException.class); assertThatThrownBy(staticInvocation::getInstanceTypeReference).isInstanceOf(IllegalStateException.class); }