From ac10d079dfc1fe385a11440fe9ca69dae177ac0e Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Thu, 19 Mar 2026 17:29:24 +0100 Subject: [PATCH] Convert assertThat(Boolean.TRUE).isEqualTo(x) to assertThat(x).isEqualTo(Boolean.TRUE) 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 ee2802868e0..f93f47a2028 100644 --- a/spring-beans/src/test/java/org/springframework/beans/AbstractPropertyAccessorTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/AbstractPropertyAccessorTests.java @@ -599,7 +599,7 @@ abstract class AbstractPropertyAccessorTests { AbstractPropertyAccessor accessor = createAccessor(target); accessor.setPropertyValue("bool2", "true"); - assertThat(Boolean.TRUE).as("Correct bool2 value").isEqualTo(accessor.getPropertyValue("bool2")); + assertThat(accessor.getPropertyValue("bool2")).as("Correct bool2 value").isEqualTo(Boolean.TRUE); assertThat(target.getBool2()).as("Correct bool2 value").isTrue(); accessor.setPropertyValue("bool2", "false"); 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 4253952e30b..ac95edc5e6b 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 @@ -187,7 +187,7 @@ class CustomEditorTests { BeanWrapper bw = new BeanWrapperImpl(tb); bw.setPropertyValue("bool1", "true"); - assertThat(Boolean.TRUE).as("Correct bool1 value").isEqualTo(bw.getPropertyValue("bool1")); + assertThat(bw.getPropertyValue("bool1")).as("Correct bool1 value").isEqualTo(Boolean.TRUE); assertThat(tb.isBool1()).as("Correct bool1 value").isTrue(); bw.setPropertyValue("bool1", "false"); @@ -228,7 +228,7 @@ class CustomEditorTests { BeanWrapper bw = new BeanWrapperImpl(tb); bw.setPropertyValue("bool2", "true"); - assertThat(Boolean.TRUE).as("Correct bool2 value").isEqualTo(bw.getPropertyValue("bool2")); + assertThat(bw.getPropertyValue("bool2")).as("Correct bool2 value").isEqualTo(Boolean.TRUE); assertThat(tb.getBool2().booleanValue()).as("Correct bool2 value").isTrue(); bw.setPropertyValue("bool2", "false"); @@ -264,7 +264,7 @@ class CustomEditorTests { bw.registerCustomEditor(Boolean.class, new CustomBooleanEditor(true)); bw.setPropertyValue("bool2", "true"); - assertThat(Boolean.TRUE).as("Correct bool2 value").isEqualTo(bw.getPropertyValue("bool2")); + assertThat(bw.getPropertyValue("bool2")).as("Correct bool2 value").isEqualTo(Boolean.TRUE); assertThat(tb.getBool2().booleanValue()).as("Correct bool2 value").isTrue(); bw.setPropertyValue("bool2", "false");