Upgrade to AssertJ 3.25.1, use AssertJ BOM

Closes gh-31945
This commit is contained in:
Stefano Cordio 2024-01-04 09:25:31 +01:00 committed by Sam Brannen
parent 19a87e968e
commit be9ee9112c
3 changed files with 3 additions and 6 deletions

View File

@ -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")

View File

@ -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<Object, Object> 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"));
});

View File

@ -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);
}