From 29ea53052518830094fe55e9134fd71b592d39c7 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Thu, 19 Mar 2026 17:37:11 +0100 Subject: [PATCH] Convert assertThat(Boolean.FALSE).isEqualTo(x) to assertThat(x).isEqualTo(Boolean.FALSE) See gh-36504 --- .../beans/AbstractPropertyAccessorTests.java | 2 +- .../beans/propertyeditors/CustomEditorTests.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-beans/src/test/java/org/springframework/beans/AbstractPropertyAccessorTests.java b/spring-beans/src/test/java/org/springframework/beans/AbstractPropertyAccessorTests.java index f93f47a2028..3bb83600abb 100644 --- a/spring-beans/src/test/java/org/springframework/beans/AbstractPropertyAccessorTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/AbstractPropertyAccessorTests.java @@ -603,7 +603,7 @@ abstract class AbstractPropertyAccessorTests { assertThat(target.getBool2()).as("Correct bool2 value").isTrue(); accessor.setPropertyValue("bool2", "false"); - assertThat(Boolean.FALSE).as("Correct bool2 value").isEqualTo(accessor.getPropertyValue("bool2")); + assertThat(accessor.getPropertyValue("bool2")).as("Correct bool2 value").isEqualTo(Boolean.FALSE); assertThat(target.getBool2()).as("Correct bool2 value").isFalse(); } diff --git a/spring-beans/src/test/java/org/springframework/beans/propertyeditors/CustomEditorTests.java b/spring-beans/src/test/java/org/springframework/beans/propertyeditors/CustomEditorTests.java index ac95edc5e6b..7214c1beaa3 100644 --- a/spring-beans/src/test/java/org/springframework/beans/propertyeditors/CustomEditorTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/propertyeditors/CustomEditorTests.java @@ -191,7 +191,7 @@ class CustomEditorTests { assertThat(tb.isBool1()).as("Correct bool1 value").isTrue(); bw.setPropertyValue("bool1", "false"); - assertThat(Boolean.FALSE).as("Correct bool1 value").isEqualTo(bw.getPropertyValue("bool1")); + assertThat(bw.getPropertyValue("bool1")).as("Correct bool1 value").isEqualTo(Boolean.FALSE); assertThat(tb.isBool1()).as("Correct bool1 value").isFalse(); bw.setPropertyValue("bool1", " true "); @@ -232,7 +232,7 @@ class CustomEditorTests { assertThat(tb.getBool2().booleanValue()).as("Correct bool2 value").isTrue(); bw.setPropertyValue("bool2", "false"); - assertThat(Boolean.FALSE).as("Correct bool2 value").isEqualTo(bw.getPropertyValue("bool2")); + assertThat(bw.getPropertyValue("bool2")).as("Correct bool2 value").isEqualTo(Boolean.FALSE); assertThat(tb.getBool2()).as("Correct bool2 value").isFalse(); bw.setPropertyValue("bool2", "on"); @@ -268,7 +268,7 @@ class CustomEditorTests { assertThat(tb.getBool2().booleanValue()).as("Correct bool2 value").isTrue(); bw.setPropertyValue("bool2", "false"); - assertThat(Boolean.FALSE).as("Correct bool2 value").isEqualTo(bw.getPropertyValue("bool2")); + assertThat(bw.getPropertyValue("bool2")).as("Correct bool2 value").isEqualTo(Boolean.FALSE); assertThat(tb.getBool2()).as("Correct bool2 value").isFalse(); bw.setPropertyValue("bool2", "on");