From 0cdb6b8939eaa1c376e236367f28106bd1187b12 Mon Sep 17 00:00:00 2001 From: Michael Fritsch Date: Thu, 17 Aug 2023 15:06:13 +0200 Subject: [PATCH] feature(#110): use Objects::deepEquals instead of deprecated Objects::areEqual --- src/test/resources/templates/my_has_assertion_template.txt | 2 +- .../templates/my_has_assertion_template_for_character.txt | 2 +- .../my_has_assertion_template_for_primitive_wrapper.txt | 2 +- .../my_has_assertion_template_for_real_number_wrapper.txt | 2 +- .../my_has_assertion_template_for_whole_number_wrapper.txt | 2 +- .../resources/templates/my_is_wrapper_assertion_template.txt | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test/resources/templates/my_has_assertion_template.txt b/src/test/resources/templates/my_has_assertion_template.txt index 44f36db..3144825 100644 --- a/src/test/resources/templates/my_has_assertion_template.txt +++ b/src/test/resources/templates/my_has_assertion_template.txt @@ -14,7 +14,7 @@ // null safe check ${propertyType} actual${Property} = actual.get${Property}(); - if (!Objects.areEqual(actual${Property}, ${property_safe})) { + if (!Objects.deepEquals(actual${Property}, ${property_safe})) { failWithMessage(assertjErrorMessage, actual, ${property_safe}, actual${Property}); } diff --git a/src/test/resources/templates/my_has_assertion_template_for_character.txt b/src/test/resources/templates/my_has_assertion_template_for_character.txt index 8b4b598..b2da9f4 100644 --- a/src/test/resources/templates/my_has_assertion_template_for_character.txt +++ b/src/test/resources/templates/my_has_assertion_template_for_character.txt @@ -14,7 +14,7 @@ // null safe check ${propertyType} actual${Property} = actual.get${Property}(); - if (!Objects.areEqual(actual${Property}, ${property_safe})) { + if (!Objects.deepEquals(actual${Property}, ${property_safe})) { failWithMessage(assertjErrorMessage, actual, ${property_safe}, actual${Property}); } diff --git a/src/test/resources/templates/my_has_assertion_template_for_primitive_wrapper.txt b/src/test/resources/templates/my_has_assertion_template_for_primitive_wrapper.txt index 6c5cf25..28bbe9d 100644 --- a/src/test/resources/templates/my_has_assertion_template_for_primitive_wrapper.txt +++ b/src/test/resources/templates/my_has_assertion_template_for_primitive_wrapper.txt @@ -14,7 +14,7 @@ // null safe check ${propertyType} actual${Property} = actual.get${Property}(); - if (!Objects.areEqual(actual${Property}, ${property_safe})) { + if (!Objects.deepEquals(actual${Property}, ${property_safe})) { failWithMessage(assertjErrorMessage, actual, ${property_safe}, actual${Property}); } diff --git a/src/test/resources/templates/my_has_assertion_template_for_real_number_wrapper.txt b/src/test/resources/templates/my_has_assertion_template_for_real_number_wrapper.txt index fc545de..4f37c95 100644 --- a/src/test/resources/templates/my_has_assertion_template_for_real_number_wrapper.txt +++ b/src/test/resources/templates/my_has_assertion_template_for_real_number_wrapper.txt @@ -14,7 +14,7 @@ // null safe check ${propertyType} actual${Property} = actual.get${Property}(); - if (!Objects.areEqual(actual${Property}, ${property_safe})) { + if (!Objects.deepEquals(actual${Property}, ${property_safe})) { failWithMessage(assertjErrorMessage, actual, ${property_safe}, actual${Property}); } diff --git a/src/test/resources/templates/my_has_assertion_template_for_whole_number_wrapper.txt b/src/test/resources/templates/my_has_assertion_template_for_whole_number_wrapper.txt index aa96a76..c912ac8 100644 --- a/src/test/resources/templates/my_has_assertion_template_for_whole_number_wrapper.txt +++ b/src/test/resources/templates/my_has_assertion_template_for_whole_number_wrapper.txt @@ -14,7 +14,7 @@ // null safe check ${propertyType} actual${Property} = actual.get${Property}(); - if (!Objects.areEqual(actual${Property}, ${property_safe})) { + if (!Objects.deepEquals(actual${Property}, ${property_safe})) { failWithMessage(assertjErrorMessage, actual, ${property_safe}, actual${Property}); } diff --git a/src/test/resources/templates/my_is_wrapper_assertion_template.txt b/src/test/resources/templates/my_is_wrapper_assertion_template.txt index 192f6ba..a5fb37c 100644 --- a/src/test/resources/templates/my_is_wrapper_assertion_template.txt +++ b/src/test/resources/templates/my_is_wrapper_assertion_template.txt @@ -9,7 +9,7 @@ isNotNull(); // null safe check - if (Objects.areEqual(Boolean.FALSE, actual.${predicate}())) { + if (Objects.deepEquals(Boolean.FALSE, actual.${predicate}())) { failWithMessage("\nExpecting that actual ${class_to_assert} ${predicate_for_error_message_part1} but ${predicate_for_error_message_part2}."); } @@ -27,7 +27,7 @@ isNotNull(); // null safe check - if (Objects.areEqual(Boolean.TRUE, actual.${predicate}())) { + if (Objects.deepEquals(Boolean.TRUE, actual.${predicate}())) { failWithMessage("\nExpecting that actual ${class_to_assert} ${negative_predicate_for_error_message_part1} but ${negative_predicate_for_error_message_part2}."); }