diff --git a/testing-modules/assertion-libraries/src/test/java/com/baeldung/assertj/AssertJConditionUnitTest.java b/testing-modules/assertion-libraries/src/test/java/com/baeldung/assertj/AssertJConditionUnitTest.java index ec2d93500f..4ed7fc3ee0 100644 --- a/testing-modules/assertion-libraries/src/test/java/com/baeldung/assertj/AssertJConditionUnitTest.java +++ b/testing-modules/assertion-libraries/src/test/java/com/baeldung/assertj/AssertJConditionUnitTest.java @@ -25,7 +25,7 @@ public class AssertJConditionUnitTest { assertThat(member).isNot(senior); fail(); } catch (AssertionError e) { - assertThat(e).hasMessageContaining("not to be "); + assertThat(e).hasMessageContaining("not to be senior"); } } @@ -38,7 +38,7 @@ public class AssertJConditionUnitTest { assertThat(member).has(nameJohn); fail(); } catch (AssertionError e) { - assertThat(e).hasMessageContaining(""); + assertThat(e).hasMessageContaining("name John"); } }