diff --git a/src/main/resources/templates/has_assertion_template.txt b/src/main/resources/templates/has_assertion_template.txt index 8a912372..e709bea6 100644 --- a/src/main/resources/templates/has_assertion_template.txt +++ b/src/main/resources/templates/has_assertion_template.txt @@ -18,6 +18,50 @@ failWithMessage(assertjErrorMessage, actual, ${property_safe}, actual${Property}); } + // return the current assertion for method chaining + return ${myself}; + } + + /** + * Verifies that the actual ${class_to_assert}'s ${property} is null. + * @return this assertion object. + * @throws AssertionError - if the actual ${class_to_assert}'s ${property} is not null.${throws_javadoc} + */ + public ${self_type} hasNull${Property}() ${throws}{ + // check that actual ${class_to_assert} we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting ${property} of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + ${propertyType} actual${Property} = actual.${getter}(); + if (actual${Property} != null) { + failWithMessage(assertjErrorMessage, actual, actual${Property}); + } + + // return the current assertion for method chaining + return ${myself}; + } + + /** + * Verifies that the actual ${class_to_assert}'s ${property} is not null. + * @return this assertion object. + * @throws AssertionError - if the actual ${class_to_assert}'s ${property} is null.${throws_javadoc} + */ + public ${self_type} hasNotNull${Property}() ${throws}{ + // check that actual ${class_to_assert} we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting ${property} of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + ${propertyType} actual${Property} = actual.${getter}(); + if (actual${Property} == null) { + failWithMessage(assertjErrorMessage, actual); + } + // return the current assertion for method chaining return ${myself}; } \ No newline at end of file diff --git a/src/main/resources/templates/has_assertion_template_for_character.txt b/src/main/resources/templates/has_assertion_template_for_character.txt index 8a912372..e709bea6 100644 --- a/src/main/resources/templates/has_assertion_template_for_character.txt +++ b/src/main/resources/templates/has_assertion_template_for_character.txt @@ -18,6 +18,50 @@ failWithMessage(assertjErrorMessage, actual, ${property_safe}, actual${Property}); } + // return the current assertion for method chaining + return ${myself}; + } + + /** + * Verifies that the actual ${class_to_assert}'s ${property} is null. + * @return this assertion object. + * @throws AssertionError - if the actual ${class_to_assert}'s ${property} is not null.${throws_javadoc} + */ + public ${self_type} hasNull${Property}() ${throws}{ + // check that actual ${class_to_assert} we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting ${property} of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + ${propertyType} actual${Property} = actual.${getter}(); + if (actual${Property} != null) { + failWithMessage(assertjErrorMessage, actual, actual${Property}); + } + + // return the current assertion for method chaining + return ${myself}; + } + + /** + * Verifies that the actual ${class_to_assert}'s ${property} is not null. + * @return this assertion object. + * @throws AssertionError - if the actual ${class_to_assert}'s ${property} is null.${throws_javadoc} + */ + public ${self_type} hasNotNull${Property}() ${throws}{ + // check that actual ${class_to_assert} we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting ${property} of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + ${propertyType} actual${Property} = actual.${getter}(); + if (actual${Property} == null) { + failWithMessage(assertjErrorMessage, actual); + } + // return the current assertion for method chaining return ${myself}; } \ No newline at end of file diff --git a/src/main/resources/templates/has_assertion_template_for_primitive_wrapper.txt b/src/main/resources/templates/has_assertion_template_for_primitive_wrapper.txt index 8a912372..e709bea6 100644 --- a/src/main/resources/templates/has_assertion_template_for_primitive_wrapper.txt +++ b/src/main/resources/templates/has_assertion_template_for_primitive_wrapper.txt @@ -18,6 +18,50 @@ failWithMessage(assertjErrorMessage, actual, ${property_safe}, actual${Property}); } + // return the current assertion for method chaining + return ${myself}; + } + + /** + * Verifies that the actual ${class_to_assert}'s ${property} is null. + * @return this assertion object. + * @throws AssertionError - if the actual ${class_to_assert}'s ${property} is not null.${throws_javadoc} + */ + public ${self_type} hasNull${Property}() ${throws}{ + // check that actual ${class_to_assert} we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting ${property} of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + ${propertyType} actual${Property} = actual.${getter}(); + if (actual${Property} != null) { + failWithMessage(assertjErrorMessage, actual, actual${Property}); + } + + // return the current assertion for method chaining + return ${myself}; + } + + /** + * Verifies that the actual ${class_to_assert}'s ${property} is not null. + * @return this assertion object. + * @throws AssertionError - if the actual ${class_to_assert}'s ${property} is null.${throws_javadoc} + */ + public ${self_type} hasNotNull${Property}() ${throws}{ + // check that actual ${class_to_assert} we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting ${property} of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + ${propertyType} actual${Property} = actual.${getter}(); + if (actual${Property} == null) { + failWithMessage(assertjErrorMessage, actual); + } + // return the current assertion for method chaining return ${myself}; } \ No newline at end of file diff --git a/src/main/resources/templates/has_assertion_template_for_real_number_wrapper.txt b/src/main/resources/templates/has_assertion_template_for_real_number_wrapper.txt index 0ef7a44a..935f3906 100644 --- a/src/main/resources/templates/has_assertion_template_for_real_number_wrapper.txt +++ b/src/main/resources/templates/has_assertion_template_for_real_number_wrapper.txt @@ -44,6 +44,50 @@ // check Assertions.assertThat(actual${Property}).overridingErrorMessage(assertjErrorMessage).isCloseTo(${property_safe}, Assertions.within(assertjOffset)); + // return the current assertion for method chaining + return ${myself}; + } + + /** + * Verifies that the actual ${class_to_assert}'s ${property} is null. + * @return this assertion object. + * @throws AssertionError - if the actual ${class_to_assert}'s ${property} is not null.${throws_javadoc} + */ + public ${self_type} hasNull${Property}() ${throws}{ + // check that actual ${class_to_assert} we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting ${property} of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + ${propertyType} actual${Property} = actual.${getter}(); + if (actual${Property} != null) { + failWithMessage(assertjErrorMessage, actual, actual${Property}); + } + + // return the current assertion for method chaining + return ${myself}; + } + + /** + * Verifies that the actual ${class_to_assert}'s ${property} is not null. + * @return this assertion object. + * @throws AssertionError - if the actual ${class_to_assert}'s ${property} is null.${throws_javadoc} + */ + public ${self_type} hasNotNull${Property}() ${throws}{ + // check that actual ${class_to_assert} we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting ${property} of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + ${propertyType} actual${Property} = actual.${getter}(); + if (actual${Property} == null) { + failWithMessage(assertjErrorMessage, actual); + } + // return the current assertion for method chaining return ${myself}; } \ No newline at end of file diff --git a/src/main/resources/templates/has_assertion_template_for_whole_number_wrapper.txt b/src/main/resources/templates/has_assertion_template_for_whole_number_wrapper.txt index 8a912372..e709bea6 100644 --- a/src/main/resources/templates/has_assertion_template_for_whole_number_wrapper.txt +++ b/src/main/resources/templates/has_assertion_template_for_whole_number_wrapper.txt @@ -18,6 +18,50 @@ failWithMessage(assertjErrorMessage, actual, ${property_safe}, actual${Property}); } + // return the current assertion for method chaining + return ${myself}; + } + + /** + * Verifies that the actual ${class_to_assert}'s ${property} is null. + * @return this assertion object. + * @throws AssertionError - if the actual ${class_to_assert}'s ${property} is not null.${throws_javadoc} + */ + public ${self_type} hasNull${Property}() ${throws}{ + // check that actual ${class_to_assert} we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting ${property} of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + ${propertyType} actual${Property} = actual.${getter}(); + if (actual${Property} != null) { + failWithMessage(assertjErrorMessage, actual, actual${Property}); + } + + // return the current assertion for method chaining + return ${myself}; + } + + /** + * Verifies that the actual ${class_to_assert}'s ${property} is not null. + * @return this assertion object. + * @throws AssertionError - if the actual ${class_to_assert}'s ${property} is null.${throws_javadoc} + */ + public ${self_type} hasNotNull${Property}() ${throws}{ + // check that actual ${class_to_assert} we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting ${property} of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + ${propertyType} actual${Property} = actual.${getter}(); + if (actual${Property} == null) { + failWithMessage(assertjErrorMessage, actual); + } + // return the current assertion for method chaining return ${myself}; } \ No newline at end of file diff --git a/src/main/resources/templates/has_elements_assertion_template_for_array.txt b/src/main/resources/templates/has_elements_assertion_template_for_array.txt index 58826935..eb1f1f49 100644 --- a/src/main/resources/templates/has_elements_assertion_template_for_array.txt +++ b/src/main/resources/templates/has_elements_assertion_template_for_array.txt @@ -81,3 +81,47 @@ // return the current assertion for method chaining return ${myself}; } + + /** + * Verifies that the actual ${class_to_assert}'s ${property} is null. + * @return this assertion object. + * @throws AssertionError - if the actual ${class_to_assert}'s ${property} is not null.${throws_javadoc} + */ + public ${self_type} hasNull${Property}() ${throws}{ + // check that actual ${class_to_assert} we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting ${property} of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + ${propertyType} actual${Property} = actual.${getter}(); + if (actual${Property} != null) { + failWithMessage(assertjErrorMessage, actual, actual${Property}); + } + + // return the current assertion for method chaining + return ${myself}; + } + + /** + * Verifies that the actual ${class_to_assert}'s ${property} is not null. + * @return this assertion object. + * @throws AssertionError - if the actual ${class_to_assert}'s ${property} is null.${throws_javadoc} + */ + public ${self_type} hasNotNull${Property}() ${throws}{ + // check that actual ${class_to_assert} we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting ${property} of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + ${propertyType} actual${Property} = actual.${getter}(); + if (actual${Property} == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return ${myself}; + } \ No newline at end of file diff --git a/src/main/resources/templates/has_elements_assertion_template_for_iterable.txt b/src/main/resources/templates/has_elements_assertion_template_for_iterable.txt index f3e42458..36eb59d8 100644 --- a/src/main/resources/templates/has_elements_assertion_template_for_iterable.txt +++ b/src/main/resources/templates/has_elements_assertion_template_for_iterable.txt @@ -150,3 +150,47 @@ // return the current assertion for method chaining return ${myself}; } + + /** + * Verifies that the actual ${class_to_assert}'s ${property} is null. + * @return this assertion object. + * @throws AssertionError - if the actual ${class_to_assert}'s ${property} is not null.${throws_javadoc} + */ + public ${self_type} hasNull${Property}() ${throws}{ + // check that actual ${class_to_assert} we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting ${property} of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + ${propertyType} actual${Property} = actual.${getter}(); + if (actual${Property} != null) { + failWithMessage(assertjErrorMessage, actual, actual${Property}); + } + + // return the current assertion for method chaining + return ${myself}; + } + + /** + * Verifies that the actual ${class_to_assert}'s ${property} is not null. + * @return this assertion object. + * @throws AssertionError - if the actual ${class_to_assert}'s ${property} is null.${throws_javadoc} + */ + public ${self_type} hasNotNull${Property}() ${throws}{ + // check that actual ${class_to_assert} we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting ${property} of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + ${propertyType} actual${Property} = actual.${getter}(); + if (actual${Property} == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return ${myself}; + } \ No newline at end of file diff --git a/src/test/resources/AbstractAnnotatedClassAssert.expected.txt b/src/test/resources/AbstractAnnotatedClassAssert.expected.txt index 1c25c79d..a5ce6f22 100644 --- a/src/test/resources/AbstractAnnotatedClassAssert.expected.txt +++ b/src/test/resources/AbstractAnnotatedClassAssert.expected.txt @@ -40,6 +40,50 @@ public abstract class AbstractAnnotatedClassAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual AnnotatedClass's anotherProperty is not null. + */ + public S hasNullAnotherProperty() { + // check that actual AnnotatedClass we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting anotherProperty of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualAnotherProperty = actual.anotherProperty(); + if (actualAnotherProperty != null) { + failWithMessage(assertjErrorMessage, actual, actualAnotherProperty); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual AnnotatedClass's anotherProperty is not null. + * @return this assertion object. + * @throws AssertionError - if the actual AnnotatedClass's anotherProperty is null. + */ + public S hasNotNullAnotherProperty() { + // check that actual AnnotatedClass we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting anotherProperty of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualAnotherProperty = actual.anotherProperty(); + if (actualAnotherProperty == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual AnnotatedClass's stuff is equal to the given one. * @param stuff the given stuff to compare the actual AnnotatedClass's stuff to. diff --git a/src/test/resources/AbstractArtWorkAssert.expected.txt b/src/test/resources/AbstractArtWorkAssert.expected.txt index 6de6155b..f2230a98 100644 --- a/src/test/resources/AbstractArtWorkAssert.expected.txt +++ b/src/test/resources/AbstractArtWorkAssert.expected.txt @@ -40,6 +40,50 @@ public abstract class AbstractArtWorkAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual ArtWork's title is not null. + */ + public S hasNullTitle() { + // check that actual ArtWork we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting title of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualTitle = actual.getTitle(); + if (actualTitle != null) { + failWithMessage(assertjErrorMessage, actual, actualTitle); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual ArtWork's title is not null. + * @return this assertion object. + * @throws AssertionError - if the actual ArtWork's title is null. + */ + public S hasNotNullTitle() { + // check that actual ArtWork we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting title of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualTitle = actual.getTitle(); + if (actualTitle == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual ArtWork's creator is equal to the given one. * @param creator the given creator to compare the actual ArtWork's creator to. @@ -63,4 +107,48 @@ public abstract class AbstractArtWorkAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual ArtWork's creator is not null. + */ + public S hasNullCreator() { + // check that actual ArtWork we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting creator of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualCreator = actual.creator; + if (actualCreator != null) { + failWithMessage(assertjErrorMessage, actual, actualCreator); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual ArtWork's creator is not null. + * @return this assertion object. + * @throws AssertionError - if the actual ArtWork's creator is null. + */ + public S hasNotNullCreator() { + // check that actual ArtWork we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting creator of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualCreator = actual.creator; + if (actualCreator == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + } diff --git a/src/test/resources/AbstractAutoValueAnnotatedClassAssert.expected.txt b/src/test/resources/AbstractAutoValueAnnotatedClassAssert.expected.txt index cb939042..e5fd346a 100644 --- a/src/test/resources/AbstractAutoValueAnnotatedClassAssert.expected.txt +++ b/src/test/resources/AbstractAutoValueAnnotatedClassAssert.expected.txt @@ -40,6 +40,50 @@ public abstract class AbstractAutoValueAnnotatedClassAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual AutoValueAnnotatedClass's anotherProperty is not null. + */ + public S hasNullAnotherProperty() { + // check that actual AutoValueAnnotatedClass we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting anotherProperty of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualAnotherProperty = actual.anotherProperty(); + if (actualAnotherProperty != null) { + failWithMessage(assertjErrorMessage, actual, actualAnotherProperty); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual AutoValueAnnotatedClass's anotherProperty is not null. + * @return this assertion object. + * @throws AssertionError - if the actual AutoValueAnnotatedClass's anotherProperty is null. + */ + public S hasNotNullAnotherProperty() { + // check that actual AutoValueAnnotatedClass we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting anotherProperty of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualAnotherProperty = actual.anotherProperty(); + if (actualAnotherProperty == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual AutoValueAnnotatedClass's stuff is equal to the given one. * @param stuff the given stuff to compare the actual AutoValueAnnotatedClass's stuff to. diff --git a/src/test/resources/AbstractClassUsingDifferentClassesWithSameNameAssert.expected.txt b/src/test/resources/AbstractClassUsingDifferentClassesWithSameNameAssert.expected.txt index 5b4c2901..b6e224e5 100644 --- a/src/test/resources/AbstractClassUsingDifferentClassesWithSameNameAssert.expected.txt +++ b/src/test/resources/AbstractClassUsingDifferentClassesWithSameNameAssert.expected.txt @@ -40,6 +40,50 @@ public abstract class AbstractClassUsingDifferentClassesWithSameNameAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual ClassUsingDifferentClassesWithSameName's nbaTeam is not null. + */ + public S hasNullNbaTeam() { + // check that actual ClassUsingDifferentClassesWithSameName we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting nbaTeam of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + org.assertj.assertions.generator.data.nba.team.Team actualNbaTeam = actual.getNbaTeam(); + if (actualNbaTeam != null) { + failWithMessage(assertjErrorMessage, actual, actualNbaTeam); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual ClassUsingDifferentClassesWithSameName's nbaTeam is not null. + * @return this assertion object. + * @throws AssertionError - if the actual ClassUsingDifferentClassesWithSameName's nbaTeam is null. + */ + public S hasNotNullNbaTeam() { + // check that actual ClassUsingDifferentClassesWithSameName we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting nbaTeam of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + org.assertj.assertions.generator.data.nba.team.Team actualNbaTeam = actual.getNbaTeam(); + if (actualNbaTeam == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual ClassUsingDifferentClassesWithSameName's team is equal to the given one. * @param team the given team to compare the actual ClassUsingDifferentClassesWithSameName's team to. @@ -63,4 +107,48 @@ public abstract class AbstractClassUsingDifferentClassesWithSameNameAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual ClassUsingDifferentClassesWithSameName's team is not null. + */ + public S hasNullTeam() { + // check that actual ClassUsingDifferentClassesWithSameName we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting team of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + org.assertj.assertions.generator.data.Team actualTeam = actual.getTeam(); + if (actualTeam != null) { + failWithMessage(assertjErrorMessage, actual, actualTeam); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual ClassUsingDifferentClassesWithSameName's team is not null. + * @return this assertion object. + * @throws AssertionError - if the actual ClassUsingDifferentClassesWithSameName's team is null. + */ + public S hasNotNullTeam() { + // check that actual ClassUsingDifferentClassesWithSameName we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting team of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + org.assertj.assertions.generator.data.Team actualTeam = actual.getTeam(); + if (actualTeam == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + } diff --git a/src/test/resources/AbstractDollar$Assert.expected.txt b/src/test/resources/AbstractDollar$Assert.expected.txt index 9ce8f4bf..146088e5 100644 --- a/src/test/resources/AbstractDollar$Assert.expected.txt +++ b/src/test/resources/AbstractDollar$Assert.expected.txt @@ -40,4 +40,48 @@ public abstract class AbstractDollar$Assertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Dollar$'s test is not null. + */ + public S hasNullTest() { + // check that actual Dollar$ we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting test of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualTest = actual.test; + if (actualTest != null) { + failWithMessage(assertjErrorMessage, actual, actualTest); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Dollar$'s test is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Dollar$'s test is null. + */ + public S hasNotNullTest() { + // check that actual Dollar$ we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting test of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualTest = actual.test; + if (actualTest == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + } diff --git a/src/test/resources/AbstractFieldPropertyClashAssert.expected.txt b/src/test/resources/AbstractFieldPropertyClashAssert.expected.txt index 5b526c28..1fdb2840 100644 --- a/src/test/resources/AbstractFieldPropertyClashAssert.expected.txt +++ b/src/test/resources/AbstractFieldPropertyClashAssert.expected.txt @@ -148,6 +148,50 @@ public abstract class AbstractFieldPropertyClashAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual FieldPropertyClash's string is not null. + */ + public S hasNullString() { + // check that actual FieldPropertyClash we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting string of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualString = actual.getString(); + if (actualString != null) { + failWithMessage(assertjErrorMessage, actual, actualString); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual FieldPropertyClash's string is not null. + * @return this assertion object. + * @throws AssertionError - if the actual FieldPropertyClash's string is null. + */ + public S hasNotNullString() { + // check that actual FieldPropertyClash we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting string of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualString = actual.getString(); + if (actualString == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual FieldPropertyClash will be upside down. * @return this assertion object. @@ -207,4 +251,48 @@ public abstract class AbstractFieldPropertyClashAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual FieldPropertyClash's actual is not null. + */ + public S hasNullActual() { + // check that actual FieldPropertyClash we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting actual of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualActual = actual.actual; + if (actualActual != null) { + failWithMessage(assertjErrorMessage, actual, actualActual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual FieldPropertyClash's actual is not null. + * @return this assertion object. + * @throws AssertionError - if the actual FieldPropertyClash's actual is null. + */ + public S hasNotNullActual() { + // check that actual FieldPropertyClash we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting actual of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualActual = actual.actual; + if (actualActual == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + } diff --git a/src/test/resources/AbstractKeywordsAssert.expected.txt b/src/test/resources/AbstractKeywordsAssert.expected.txt index f468a818..64467342 100644 --- a/src/test/resources/AbstractKeywordsAssert.expected.txt +++ b/src/test/resources/AbstractKeywordsAssert.expected.txt @@ -43,6 +43,52 @@ public abstract class AbstractKeywordsAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's abstract is not null. + * @throws java.io.IOException if actual.getAbstract() throws one. + */ + public S hasNullAbstract() throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting abstract of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualAbstract = actual.getAbstract(); + if (actualAbstract != null) { + failWithMessage(assertjErrorMessage, actual, actualAbstract); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's abstract is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's abstract is null. + * @throws java.io.IOException if actual.getAbstract() throws one. + */ + public S hasNotNullAbstract() throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting abstract of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualAbstract = actual.getAbstract(); + if (actualAbstract == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Keywords's assert is equal to the given one. * @param expectedAssert the given assert to compare the actual Keywords's assert to. @@ -66,6 +112,50 @@ public abstract class AbstractKeywordsAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's assert is not null. + */ + public S hasNullAssert() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting assert of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualAssert = actual.getAssert(); + if (actualAssert != null) { + failWithMessage(assertjErrorMessage, actual, actualAssert); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's assert is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's assert is null. + */ + public S hasNotNullAssert() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting assert of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualAssert = actual.getAssert(); + if (actualAssert == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Keywords's boolean is equal to the given one. * @param expectedBoolean the given boolean to compare the actual Keywords's boolean to. @@ -89,6 +179,50 @@ public abstract class AbstractKeywordsAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's boolean is not null. + */ + public S hasNullBoolean() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting boolean of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Boolean actualBoolean = actual.getBoolean(); + if (actualBoolean != null) { + failWithMessage(assertjErrorMessage, actual, actualBoolean); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's boolean is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's boolean is null. + */ + public S hasNotNullBoolean() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting boolean of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Boolean actualBoolean = actual.getBoolean(); + if (actualBoolean == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Keywords's break contains the given Object elements. * @param expectedBreak the given elements that should be contained in actual Keywords's break. @@ -241,6 +375,49 @@ public abstract class AbstractKeywordsAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's break is not null. + */ + public S hasNullBreak() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting break of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualBreak = actual.getBreak(); + if (actualBreak != null) { + failWithMessage(assertjErrorMessage, actual, actualBreak); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's break is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's break is null. + */ + public S hasNotNullBreak() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting break of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualBreak = actual.getBreak(); + if (actualBreak == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } /** * Verifies that the actual Keywords's byte is equal to the given one. @@ -265,6 +442,50 @@ public abstract class AbstractKeywordsAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's byte is not null. + */ + public S hasNullByte() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting byte of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Byte actualByte = actual.getByte(); + if (actualByte != null) { + failWithMessage(assertjErrorMessage, actual, actualByte); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's byte is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's byte is null. + */ + public S hasNotNullByte() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting byte of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Byte actualByte = actual.getByte(); + if (actualByte == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Keywords's case contains the given Object elements. * @param expectedCase the given elements that should be contained in actual Keywords's case. @@ -348,6 +569,49 @@ public abstract class AbstractKeywordsAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's case is not null. + */ + public S hasNullCase() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting case of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object[] actualCase = actual.getCase(); + if (actualCase != null) { + failWithMessage(assertjErrorMessage, actual, actualCase); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's case is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's case is null. + */ + public S hasNotNullCase() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting case of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object[] actualCase = actual.getCase(); + if (actualCase == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } /** * Verifies that the actual Keywords's catch is equal to the given one. @@ -372,6 +636,50 @@ public abstract class AbstractKeywordsAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's catch is not null. + */ + public S hasNullCatch() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting catch of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualCatch = actual.getCatch(); + if (actualCatch != null) { + failWithMessage(assertjErrorMessage, actual, actualCatch); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's catch is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's catch is null. + */ + public S hasNotNullCatch() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting catch of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualCatch = actual.getCatch(); + if (actualCatch == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Keywords's char is equal to the given one. * @param expectedChar the given char to compare the actual Keywords's char to. @@ -455,22 +763,21 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's continue is not equal to the given one. + * @throws AssertionError - if the actual Keywords's const is not null. */ - public S hasContinue(String expectedContinue) { + public S hasNullConst() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting continue of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting const of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // null safe check - String actualContinue = actual.getContinue(); - if (!Objects.areEqual(actualContinue, expectedContinue)) { - failWithMessage(assertjErrorMessage, actual, expectedContinue, actualContinue); + // check + Class actualConst = actual.getConst(); + if (actualConst != null) { + failWithMessage(assertjErrorMessage, actual, actualConst); } // return the current assertion for method chaining @@ -478,40 +785,129 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError if the actual Keywords's default does not contain all given String elements. - * @throws java.io.IOException if actual.getDefault() throws one. + * @throws AssertionError - if the actual Keywords's const is null. */ - public S hasDefault(String... expectedDefault) throws java.io.IOException { + public S hasNotNullConst() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); - // check that given String varargs is not null. - if (expectedDefault == null) failWithMessage("Expecting default parameter not to be null."); + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting const of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // check with standard error message, to set another message call: info.overridingErrorMessage("my error message"); - Iterables.instance().assertContains(info, actual.getDefault(), expectedDefault); + // check + Class actualConst = actual.getConst(); + if (actualConst == null) { + failWithMessage(assertjErrorMessage, actual); + } // return the current assertion for method chaining return myself; } /** - * Verifies that the actual Keywords's default contains the given String elements in Collection. - * @param expectedDefault the given elements that should be contained in actual Keywords's default. + * Verifies that the actual Keywords's continue is equal to the given one. + * @param expectedContinue the given continue to compare the actual Keywords's continue to. * @return this assertion object. - * @throws AssertionError if the actual Keywords's default does not contain all given String elements. - * @throws java.io.IOException if actual.getDefault() throws one. + * @throws AssertionError - if the actual Keywords's continue is not equal to the given one. */ - public S hasDefault(java.util.Collection expectedDefault) throws java.io.IOException { + public S hasContinue(String expectedContinue) { // check that actual Keywords we want to make assertions on is not null. isNotNull(); - // check that given String collection is not null. - if (expectedDefault == null) { - failWithMessage("Expecting default parameter not to be null."); + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting continue of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + String actualContinue = actual.getContinue(); + if (!Objects.areEqual(actualContinue, expectedContinue)) { + failWithMessage(assertjErrorMessage, actual, expectedContinue, actualContinue); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's continue is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's continue is not null. + */ + public S hasNullContinue() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting continue of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualContinue = actual.getContinue(); + if (actualContinue != null) { + failWithMessage(assertjErrorMessage, actual, actualContinue); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's continue is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's continue is null. + */ + public S hasNotNullContinue() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting continue of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualContinue = actual.getContinue(); + if (actualContinue == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's default contains the given String elements. + * @param expectedDefault the given elements that should be contained in actual Keywords's default. + * @return this assertion object. + * @throws AssertionError if the actual Keywords's default does not contain all given String elements. + * @throws java.io.IOException if actual.getDefault() throws one. + */ + public S hasDefault(String... expectedDefault) throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // check that given String varargs is not null. + if (expectedDefault == null) failWithMessage("Expecting default parameter not to be null."); + + // check with standard error message, to set another message call: info.overridingErrorMessage("my error message"); + Iterables.instance().assertContains(info, actual.getDefault(), expectedDefault); + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's default contains the given String elements in Collection. + * @param expectedDefault the given elements that should be contained in actual Keywords's default. + * @return this assertion object. + * @throws AssertionError if the actual Keywords's default does not contain all given String elements. + * @throws java.io.IOException if actual.getDefault() throws one. + */ + public S hasDefault(java.util.Collection expectedDefault) throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // check that given String collection is not null. + if (expectedDefault == null) { + failWithMessage("Expecting default parameter not to be null."); return myself; // to fool Eclipse "Null pointer access" warning on toArray. } @@ -636,6 +1032,51 @@ public abstract class AbstractKeywordsAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's default is not null. + * @throws java.io.IOException if actual.getDefault() throws one. + */ + public S hasNullDefault() throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting default of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualDefault = actual.getDefault(); + if (actualDefault != null) { + failWithMessage(assertjErrorMessage, actual, actualDefault); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's default is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's default is null. + * @throws java.io.IOException if actual.getDefault() throws one. + */ + public S hasNotNullDefault() throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting default of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualDefault = actual.getDefault(); + if (actualDefault == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } /** * Verifies that the actual Keywords's do is equal to the given one. @@ -660,6 +1101,50 @@ public abstract class AbstractKeywordsAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's do is not null. + */ + public S hasNullDo() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting do of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualDo = actual.getDo(); + if (actualDo != null) { + failWithMessage(assertjErrorMessage, actual, actualDo); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's do is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's do is null. + */ + public S hasNotNullDo() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting do of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualDo = actual.getDo(); + if (actualDo == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Keywords's double is equal to the given one. * @param expectedDouble the given double to compare the actual Keywords's double to. @@ -733,22 +1218,21 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's enum is not equal to the given one. + * @throws AssertionError - if the actual Keywords's else is not null. */ - public S hasEnum(Object expectedEnum) { + public S hasNullElse() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting enum of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting else of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // null safe check - Object actualEnum = actual.getEnum(); - if (!Objects.areEqual(actualEnum, expectedEnum)) { - failWithMessage(assertjErrorMessage, actual, expectedEnum, actualEnum); + // check + Object actualElse = actual.getElse(); + if (actualElse != null) { + failWithMessage(assertjErrorMessage, actual, actualElse); } // return the current assertion for method chaining @@ -756,22 +1240,21 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's extends is not equal to the given one. + * @throws AssertionError - if the actual Keywords's else is null. */ - public S hasExtends(Object expectedExtends) { + public S hasNotNullElse() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting extends of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting else of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // null safe check - Object actualExtends = actual.getExtends(); - if (!Objects.areEqual(actualExtends, expectedExtends)) { - failWithMessage(assertjErrorMessage, actual, expectedExtends, actualExtends); + // check + Object actualElse = actual.getElse(); + if (actualElse == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -779,22 +1262,22 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's final is not equal to the given one. + * @throws AssertionError - if the actual Keywords's enum is not null. */ - public S hasFinal(Object expectedFinal) { + public S hasNullEnum() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting final of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting enum of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // null safe check - Object actualFinal = actual.getFinal(); - if (!Objects.areEqual(actualFinal, expectedFinal)) { - failWithMessage(assertjErrorMessage, actual, expectedFinal, actualFinal); + // check + Object actualEnum = actual.getEnum(); + if (actualEnum != null) { + failWithMessage(assertjErrorMessage, actual, actualEnum); } // return the current assertion for method chaining @@ -825,22 +1307,21 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's finally is not equal to the given one. + * @throws AssertionError - if the actual Keywords's enum is null. */ - public S hasFinally(Object expectedFinally) { + public S hasNotNullEnum() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting finally of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting enum of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // null safe check - Object actualFinally = actual.getFinally(); - if (!Objects.areEqual(actualFinally, expectedFinally)) { - failWithMessage(assertjErrorMessage, actual, expectedFinally, actualFinally); + // check + Object actualEnum = actual.getEnum(); + if (actualEnum == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -848,22 +1329,22 @@ public abstract class AbstractKeywordsAssert - * If difference is equal to the offset value, assertion is considered successful. - * @param expectedFloat the value to compare the actual Keywords's float to. - * @param assertjOffset the given offset. + * Verifies that the actual Keywords's extends is null. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's float is not close enough to the given value. + * @throws AssertionError - if the actual Keywords's extends is not null. */ - public S hasFloatCloseTo(float expectedFloat, float assertjOffset) { + public S hasNullExtends() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); - float actualFloat = actual.getFloat(); - // overrides the default error message with a more explicit one - String assertjErrorMessage = String.format("\nExpecting float:\n <%s>\nto be close to:\n <%s>\nby less than <%s> but difference was <%s>", - actualFloat, expectedFloat, assertjOffset, Math.abs(expectedFloat - actualFloat)); + String assertjErrorMessage = "\nExpecting extends of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; // check - Assertions.assertThat(actualFloat).overridingErrorMessage(assertjErrorMessage).isCloseTo(expectedFloat, Assertions.within(assertjOffset)); + Object actualExtends = actual.getExtends(); + if (actualExtends != null) { + failWithMessage(assertjErrorMessage, actual, actualExtends); + } // return the current assertion for method chaining return myself; } /** - * Verifies that the actual Keywords's for is equal to the given one. - * @param expectedFor the given for to compare the actual Keywords's for to. + * Verifies that the actual Keywords's extends is not null. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's for is not equal to the given one. - * @throws java.io.IOException if actual.getFor() throws one. + * @throws AssertionError - if the actual Keywords's extends is null. */ - public S hasFor(Object expectedFor) throws java.io.IOException { + public S hasNotNullExtends() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting for of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting extends of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // null safe check - Object actualFor = actual.getFor(); - if (!Objects.areEqual(actualFor, expectedFor)) { - failWithMessage(assertjErrorMessage, actual, expectedFor, actualFor); + // check + Object actualExtends = actual.getExtends(); + if (actualExtends == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -921,22 +1396,22 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's if is not equal to the given one. + * @throws AssertionError - if the actual Keywords's false is not null. */ - public S hasIf(Object expectedIf) { + public S hasNullFalse() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting if of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting false of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // null safe check - Object actualIf = actual.getIf(); - if (!Objects.areEqual(actualIf, expectedIf)) { - failWithMessage(assertjErrorMessage, actual, expectedIf, actualIf); + // check + Object actualFalse = actual.getFalse(); + if (actualFalse != null) { + failWithMessage(assertjErrorMessage, actual, actualFalse); } // return the current assertion for method chaining @@ -967,22 +1441,21 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's implements is not equal to the given one. + * @throws AssertionError - if the actual Keywords's false is null. */ - public S hasImplements(Object expectedImplements) { + public S hasNotNullFalse() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting implements of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting false of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // null safe check - Object actualImplements = actual.getImplements(); - if (!Objects.areEqual(actualImplements, expectedImplements)) { - failWithMessage(assertjErrorMessage, actual, expectedImplements, actualImplements); + // check + Object actualFalse = actual.getFalse(); + if (actualFalse == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -990,22 +1463,22 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's instanceof is not equal to the given one. + * @throws AssertionError - if the actual Keywords's final is not null. */ - public S hasInstanceof(Object expectedInstanceof) { + public S hasNullFinal() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting instanceof of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting final of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // null safe check - Object actualInstanceof = actual.getInstanceof(); - if (!Objects.areEqual(actualInstanceof, expectedInstanceof)) { - failWithMessage(assertjErrorMessage, actual, expectedInstanceof, actualInstanceof); + // check + Object actualFinal = actual.getFinal(); + if (actualFinal != null) { + failWithMessage(assertjErrorMessage, actual, actualFinal); } // return the current assertion for method chaining @@ -1036,23 +1508,21 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's int is not equal to the given one. - * @throws java.io.IOException if actual.getInt() throws one. + * @throws AssertionError - if the actual Keywords's final is null. */ - public S hasInt(int expectedInt) throws java.io.IOException { + public S hasNotNullFinal() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting int of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting final of:\n <%s>\nto be:\n not-null\nbut was:\n "; // check - int actualInt = actual.getInt(); - if (actualInt != expectedInt) { - failWithMessage(assertjErrorMessage, actual, expectedInt, actualInt); + Object actualFinal = actual.getFinal(); + if (actualFinal == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -1060,22 +1530,22 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's long is not equal to the given one. + * @throws AssertionError - if the actual Keywords's finally is not null. */ - public S hasLong(long expectedLong) { + public S hasNullFinally() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting long of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting finally of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; // check - long actualLong = actual.getLong(); - if (actualLong != expectedLong) { - failWithMessage(assertjErrorMessage, actual, expectedLong, actualLong); + Object actualFinally = actual.getFinally(); + if (actualFinally != null) { + failWithMessage(assertjErrorMessage, actual, actualFinally); } // return the current assertion for method chaining @@ -1106,22 +1575,21 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's native is not equal to the given one. + * @throws AssertionError - if the actual Keywords's finally is null. */ - public S hasNative(Object expectedNative) { + public S hasNotNullFinally() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting native of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting finally of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // null safe check - Object actualNative = actual.getNative(); - if (!Objects.areEqual(actualNative, expectedNative)) { - failWithMessage(assertjErrorMessage, actual, expectedNative, actualNative); + // check + Object actualFinally = actual.getFinally(); + if (actualFinally == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -1129,22 +1597,22 @@ public abstract class AbstractKeywordsAssert + * If difference is equal to the offset value, assertion is considered successful. + * @param expectedFloat the value to compare the actual Keywords's float to. + * @param assertjOffset the given offset. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's null is not equal to the given one. + * @throws AssertionError - if the actual Keywords's float is not close enough to the given value. */ - public S hasNull(Object expectedNull) { + public S hasFloatCloseTo(float expectedFloat, float assertjOffset) { // check that actual Keywords we want to make assertions on is not null. isNotNull(); + float actualFloat = actual.getFloat(); + // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting null of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = String.format("\nExpecting float:\n <%s>\nto be close to:\n <%s>\nby less than <%s> but difference was <%s>", + actualFloat, expectedFloat, assertjOffset, Math.abs(expectedFloat - actualFloat)); - // null safe check - Object actualNull = actual.getNull(); - if (!Objects.areEqual(actualNull, expectedNull)) { - failWithMessage(assertjErrorMessage, actual, expectedNull, actualNull); - } + // check + Assertions.assertThat(actualFloat).overridingErrorMessage(assertjErrorMessage).isCloseTo(expectedFloat, Assertions.within(assertjOffset)); // return the current assertion for method chaining return myself; } /** - * Verifies that the actual Keywords's package is equal to the given one. - * @param expectedPackage the given package to compare the actual Keywords's package to. + * Verifies that the actual Keywords's for is equal to the given one. + * @param expectedFor the given for to compare the actual Keywords's for to. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's package is not equal to the given one. + * @throws AssertionError - if the actual Keywords's for is not equal to the given one. + * @throws java.io.IOException if actual.getFor() throws one. */ - public S hasPackage(Object expectedPackage) { + public S hasFor(Object expectedFor) throws java.io.IOException { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting package of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting for of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; // null safe check - Object actualPackage = actual.getPackage(); - if (!Objects.areEqual(actualPackage, expectedPackage)) { - failWithMessage(assertjErrorMessage, actual, expectedPackage, actualPackage); + Object actualFor = actual.getFor(); + if (!Objects.areEqual(actualFor, expectedFor)) { + failWithMessage(assertjErrorMessage, actual, expectedFor, actualFor); } // return the current assertion for method chaining @@ -1198,22 +1670,22 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's private is not equal to the given one. + * @throws AssertionError - if the actual Keywords's for is not null. + * @throws java.io.IOException if actual.getFor() throws one. */ - public S hasPrivate(Object expectedPrivate) { + public S hasNullFor() throws java.io.IOException { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting private of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting for of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // null safe check - Object actualPrivate = actual.getPrivate(); - if (!Objects.areEqual(actualPrivate, expectedPrivate)) { - failWithMessage(assertjErrorMessage, actual, expectedPrivate, actualPrivate); + // check + Object actualFor = actual.getFor(); + if (actualFor != null) { + failWithMessage(assertjErrorMessage, actual, actualFor); } // return the current assertion for method chaining @@ -1221,22 +1693,22 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's protected is not equal to the given one. + * @throws AssertionError - if the actual Keywords's for is null. + * @throws java.io.IOException if actual.getFor() throws one. */ - public S hasProtected(Object expectedProtected) { + public S hasNotNullFor() throws java.io.IOException { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting protected of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting for of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // null safe check - Object actualProtected = actual.getProtected(); - if (!Objects.areEqual(actualProtected, expectedProtected)) { - failWithMessage(assertjErrorMessage, actual, expectedProtected, actualProtected); + // check + Object actualFor = actual.getFor(); + if (actualFor == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -1244,22 +1716,22 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's return is not equal to the given one. + * @throws AssertionError - if the actual Keywords's goto is not null. */ - public S hasReturn(Object expectedReturn) { + public S hasNullGoto() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting return of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting goto of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // null safe check - Object actualReturn = actual.getReturn(); - if (!Objects.areEqual(actualReturn, expectedReturn)) { - failWithMessage(assertjErrorMessage, actual, expectedReturn, actualReturn); + // check + Object actualGoto = actual.getGoto(); + if (actualGoto != null) { + failWithMessage(assertjErrorMessage, actual, actualGoto); } // return the current assertion for method chaining @@ -1290,22 +1761,21 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's short is not equal to the given one. + * @throws AssertionError - if the actual Keywords's goto is null. */ - public S hasShort(short expectedShort) { + public S hasNotNullGoto() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting short of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting goto of:\n <%s>\nto be:\n not-null\nbut was:\n "; // check - short actualShort = actual.getShort(); - if (actualShort != expectedShort) { - failWithMessage(assertjErrorMessage, actual, expectedShort, actualShort); + Object actualGoto = actual.getGoto(); + if (actualGoto == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -1313,22 +1783,22 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's strictfp is not equal to the given one. + * @throws AssertionError - if the actual Keywords's if is not null. */ - public S hasStrictfp(Object expectedStrictfp) { + public S hasNullIf() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting strictfp of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting if of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // null safe check - Object actualStrictfp = actual.getStrictfp(); - if (!Objects.areEqual(actualStrictfp, expectedStrictfp)) { - failWithMessage(assertjErrorMessage, actual, expectedStrictfp, actualStrictfp); + // check + Object actualIf = actual.getIf(); + if (actualIf != null) { + failWithMessage(assertjErrorMessage, actual, actualIf); } // return the current assertion for method chaining @@ -1359,22 +1828,1453 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's super is not equal to the given one. + * @throws AssertionError - if the actual Keywords's if is null. */ - public S hasSuper(Object expectedSuper) { + public S hasNotNullIf() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting super of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting if of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // null safe check - Object actualSuper = actual.getSuper(); - if (!Objects.areEqual(actualSuper, expectedSuper)) { - failWithMessage(assertjErrorMessage, actual, expectedSuper, actualSuper); + // check + Object actualIf = actual.getIf(); + if (actualIf == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's implements is equal to the given one. + * @param expectedImplements the given implements to compare the actual Keywords's implements to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's implements is not equal to the given one. + */ + public S hasImplements(Object expectedImplements) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting implements of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualImplements = actual.getImplements(); + if (!Objects.areEqual(actualImplements, expectedImplements)) { + failWithMessage(assertjErrorMessage, actual, expectedImplements, actualImplements); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's implements is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's implements is not null. + */ + public S hasNullImplements() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting implements of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualImplements = actual.getImplements(); + if (actualImplements != null) { + failWithMessage(assertjErrorMessage, actual, actualImplements); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's implements is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's implements is null. + */ + public S hasNotNullImplements() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting implements of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualImplements = actual.getImplements(); + if (actualImplements == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's import is equal to the given one. + * @param expectedImport the given import to compare the actual Keywords's import to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's import is not equal to the given one. + */ + public S hasImport(Object expectedImport) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting import of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualImport = actual.getImport(); + if (!Objects.areEqual(actualImport, expectedImport)) { + failWithMessage(assertjErrorMessage, actual, expectedImport, actualImport); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's import is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's import is not null. + */ + public S hasNullImport() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting import of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualImport = actual.getImport(); + if (actualImport != null) { + failWithMessage(assertjErrorMessage, actual, actualImport); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's import is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's import is null. + */ + public S hasNotNullImport() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting import of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualImport = actual.getImport(); + if (actualImport == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's instanceof is equal to the given one. + * @param expectedInstanceof the given instanceof to compare the actual Keywords's instanceof to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's instanceof is not equal to the given one. + */ + public S hasInstanceof(Object expectedInstanceof) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting instanceof of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualInstanceof = actual.getInstanceof(); + if (!Objects.areEqual(actualInstanceof, expectedInstanceof)) { + failWithMessage(assertjErrorMessage, actual, expectedInstanceof, actualInstanceof); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's instanceof is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's instanceof is not null. + */ + public S hasNullInstanceof() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting instanceof of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualInstanceof = actual.getInstanceof(); + if (actualInstanceof != null) { + failWithMessage(assertjErrorMessage, actual, actualInstanceof); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's instanceof is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's instanceof is null. + */ + public S hasNotNullInstanceof() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting instanceof of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualInstanceof = actual.getInstanceof(); + if (actualInstanceof == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's int is equal to the given one. + * @param expectedInt the given int to compare the actual Keywords's int to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's int is not equal to the given one. + * @throws java.io.IOException if actual.getInt() throws one. + */ + public S hasInt(int expectedInt) throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting int of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // check + int actualInt = actual.getInt(); + if (actualInt != expectedInt) { + failWithMessage(assertjErrorMessage, actual, expectedInt, actualInt); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's interface is equal to the given one. + * @param expectedInterface the given interface to compare the actual Keywords's interface to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's interface is not equal to the given one. + */ + public S hasInterface(Object expectedInterface) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting interface of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualInterface = actual.getInterface(); + if (!Objects.areEqual(actualInterface, expectedInterface)) { + failWithMessage(assertjErrorMessage, actual, expectedInterface, actualInterface); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's interface is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's interface is not null. + */ + public S hasNullInterface() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting interface of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualInterface = actual.getInterface(); + if (actualInterface != null) { + failWithMessage(assertjErrorMessage, actual, actualInterface); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's interface is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's interface is null. + */ + public S hasNotNullInterface() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting interface of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualInterface = actual.getInterface(); + if (actualInterface == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's long is equal to the given one. + * @param expectedLong the given long to compare the actual Keywords's long to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's long is not equal to the given one. + */ + public S hasLong(long expectedLong) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting long of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // check + long actualLong = actual.getLong(); + if (actualLong != expectedLong) { + failWithMessage(assertjErrorMessage, actual, expectedLong, actualLong); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's native is equal to the given one. + * @param expectedNative the given native to compare the actual Keywords's native to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's native is not equal to the given one. + */ + public S hasNative(Object expectedNative) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting native of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualNative = actual.getNative(); + if (!Objects.areEqual(actualNative, expectedNative)) { + failWithMessage(assertjErrorMessage, actual, expectedNative, actualNative); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's native is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's native is not null. + */ + public S hasNullNative() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting native of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualNative = actual.getNative(); + if (actualNative != null) { + failWithMessage(assertjErrorMessage, actual, actualNative); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's native is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's native is null. + */ + public S hasNotNullNative() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting native of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualNative = actual.getNative(); + if (actualNative == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's new is equal to the given one. + * @param expectedNew the given new to compare the actual Keywords's new to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's new is not equal to the given one. + */ + public S hasNew(Object expectedNew) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting new of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualNew = actual.getNew(); + if (!Objects.areEqual(actualNew, expectedNew)) { + failWithMessage(assertjErrorMessage, actual, expectedNew, actualNew); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's new is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's new is not null. + */ + public S hasNullNew() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting new of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualNew = actual.getNew(); + if (actualNew != null) { + failWithMessage(assertjErrorMessage, actual, actualNew); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's new is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's new is null. + */ + public S hasNotNullNew() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting new of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualNew = actual.getNew(); + if (actualNew == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's null is equal to the given one. + * @param expectedNull the given null to compare the actual Keywords's null to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's null is not equal to the given one. + */ + public S hasNull(Object expectedNull) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting null of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualNull = actual.getNull(); + if (!Objects.areEqual(actualNull, expectedNull)) { + failWithMessage(assertjErrorMessage, actual, expectedNull, actualNull); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's null is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's null is not null. + */ + public S hasNullNull() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting null of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualNull = actual.getNull(); + if (actualNull != null) { + failWithMessage(assertjErrorMessage, actual, actualNull); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's null is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's null is null. + */ + public S hasNotNullNull() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting null of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualNull = actual.getNull(); + if (actualNull == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's package is equal to the given one. + * @param expectedPackage the given package to compare the actual Keywords's package to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's package is not equal to the given one. + */ + public S hasPackage(Object expectedPackage) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting package of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualPackage = actual.getPackage(); + if (!Objects.areEqual(actualPackage, expectedPackage)) { + failWithMessage(assertjErrorMessage, actual, expectedPackage, actualPackage); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's package is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's package is not null. + */ + public S hasNullPackage() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting package of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualPackage = actual.getPackage(); + if (actualPackage != null) { + failWithMessage(assertjErrorMessage, actual, actualPackage); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's package is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's package is null. + */ + public S hasNotNullPackage() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting package of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualPackage = actual.getPackage(); + if (actualPackage == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's private is equal to the given one. + * @param expectedPrivate the given private to compare the actual Keywords's private to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's private is not equal to the given one. + */ + public S hasPrivate(Object expectedPrivate) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting private of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualPrivate = actual.getPrivate(); + if (!Objects.areEqual(actualPrivate, expectedPrivate)) { + failWithMessage(assertjErrorMessage, actual, expectedPrivate, actualPrivate); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's private is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's private is not null. + */ + public S hasNullPrivate() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting private of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualPrivate = actual.getPrivate(); + if (actualPrivate != null) { + failWithMessage(assertjErrorMessage, actual, actualPrivate); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's private is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's private is null. + */ + public S hasNotNullPrivate() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting private of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualPrivate = actual.getPrivate(); + if (actualPrivate == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's protected is equal to the given one. + * @param expectedProtected the given protected to compare the actual Keywords's protected to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's protected is not equal to the given one. + */ + public S hasProtected(Object expectedProtected) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting protected of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualProtected = actual.getProtected(); + if (!Objects.areEqual(actualProtected, expectedProtected)) { + failWithMessage(assertjErrorMessage, actual, expectedProtected, actualProtected); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's protected is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's protected is not null. + */ + public S hasNullProtected() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting protected of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualProtected = actual.getProtected(); + if (actualProtected != null) { + failWithMessage(assertjErrorMessage, actual, actualProtected); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's protected is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's protected is null. + */ + public S hasNotNullProtected() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting protected of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualProtected = actual.getProtected(); + if (actualProtected == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's public is equal to the given one. + * @param expectedPublic the given public to compare the actual Keywords's public to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's public is not equal to the given one. + */ + public S hasPublic(Object expectedPublic) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting public of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualPublic = actual.getPublic(); + if (!Objects.areEqual(actualPublic, expectedPublic)) { + failWithMessage(assertjErrorMessage, actual, expectedPublic, actualPublic); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's public is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's public is not null. + */ + public S hasNullPublic() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting public of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualPublic = actual.getPublic(); + if (actualPublic != null) { + failWithMessage(assertjErrorMessage, actual, actualPublic); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's public is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's public is null. + */ + public S hasNotNullPublic() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting public of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualPublic = actual.getPublic(); + if (actualPublic == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's return is equal to the given one. + * @param expectedReturn the given return to compare the actual Keywords's return to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's return is not equal to the given one. + */ + public S hasReturn(Object expectedReturn) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting return of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualReturn = actual.getReturn(); + if (!Objects.areEqual(actualReturn, expectedReturn)) { + failWithMessage(assertjErrorMessage, actual, expectedReturn, actualReturn); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's return is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's return is not null. + */ + public S hasNullReturn() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting return of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualReturn = actual.getReturn(); + if (actualReturn != null) { + failWithMessage(assertjErrorMessage, actual, actualReturn); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's return is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's return is null. + */ + public S hasNotNullReturn() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting return of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualReturn = actual.getReturn(); + if (actualReturn == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's short is equal to the given one. + * @param expectedShort the given short to compare the actual Keywords's short to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's short is not equal to the given one. + */ + public S hasShort(short expectedShort) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting short of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // check + short actualShort = actual.getShort(); + if (actualShort != expectedShort) { + failWithMessage(assertjErrorMessage, actual, expectedShort, actualShort); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's static is equal to the given one. + * @param expectedStatic the given static to compare the actual Keywords's static to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's static is not equal to the given one. + */ + public S hasStatic(Object expectedStatic) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting static of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualStatic = actual.getStatic(); + if (!Objects.areEqual(actualStatic, expectedStatic)) { + failWithMessage(assertjErrorMessage, actual, expectedStatic, actualStatic); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's static is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's static is not null. + */ + public S hasNullStatic() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting static of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualStatic = actual.getStatic(); + if (actualStatic != null) { + failWithMessage(assertjErrorMessage, actual, actualStatic); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's static is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's static is null. + */ + public S hasNotNullStatic() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting static of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualStatic = actual.getStatic(); + if (actualStatic == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's strictfp is equal to the given one. + * @param expectedStrictfp the given strictfp to compare the actual Keywords's strictfp to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's strictfp is not equal to the given one. + */ + public S hasStrictfp(Object expectedStrictfp) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting strictfp of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualStrictfp = actual.getStrictfp(); + if (!Objects.areEqual(actualStrictfp, expectedStrictfp)) { + failWithMessage(assertjErrorMessage, actual, expectedStrictfp, actualStrictfp); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's strictfp is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's strictfp is not null. + */ + public S hasNullStrictfp() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting strictfp of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualStrictfp = actual.getStrictfp(); + if (actualStrictfp != null) { + failWithMessage(assertjErrorMessage, actual, actualStrictfp); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's strictfp is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's strictfp is null. + */ + public S hasNotNullStrictfp() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting strictfp of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualStrictfp = actual.getStrictfp(); + if (actualStrictfp == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's super is equal to the given one. + * @param expectedSuper the given super to compare the actual Keywords's super to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's super is not equal to the given one. + */ + public S hasSuper(Object expectedSuper) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting super of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualSuper = actual.getSuper(); + if (!Objects.areEqual(actualSuper, expectedSuper)) { + failWithMessage(assertjErrorMessage, actual, expectedSuper, actualSuper); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's super is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's super is not null. + */ + public S hasNullSuper() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting super of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualSuper = actual.getSuper(); + if (actualSuper != null) { + failWithMessage(assertjErrorMessage, actual, actualSuper); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's super is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's super is null. + */ + public S hasNotNullSuper() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting super of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualSuper = actual.getSuper(); + if (actualSuper == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's switch contains the given String elements. + * @param expectedSwitch the given elements that should be contained in actual Keywords's switch. + * @return this assertion object. + * @throws AssertionError if the actual Keywords's switch does not contain all given String elements. + * @throws java.io.IOException if actual.getSwitch() throws one. + */ + public S hasSwitch(String... expectedSwitch) throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // check that given String varargs is not null. + if (expectedSwitch == null) failWithMessage("Expecting switch parameter not to be null."); + + // check with standard error message (use overridingErrorMessage before contains to set your own message). + Assertions.assertThat(actual.getSwitch()).contains(expectedSwitch); + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's switch contains only the given String elements and nothing else in whatever order. + * + * @param expectedSwitch the given elements that should be contained in actual Keywords's switch. + * @return this assertion object. + * @throws AssertionError if the actual Keywords's switch does not contain all given String elements and nothing else. + * @throws java.io.IOException if actual.getSwitch() throws one. + */ + public S hasOnlySwitch(String... expectedSwitch) throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // check that given String varargs is not null. + if (expectedSwitch == null) failWithMessage("Expecting switch parameter not to be null."); + + // check with standard error message (use overridingErrorMessage before contains to set your own message). + Assertions.assertThat(actual.getSwitch()).containsOnly(expectedSwitch); + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's switch does not contain the given String elements. + * + * @param expectedSwitch the given elements that should not be in actual Keywords's switch. + * @return this assertion object. + * @throws AssertionError if the actual Keywords's switch contains any given String elements. + * @throws java.io.IOException if actual.getSwitch() throws one. + */ + public S doesNotHaveSwitch(String... expectedSwitch) throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // check that given String varargs is not null. + if (expectedSwitch == null) failWithMessage("Expecting switch parameter not to be null."); + + // check with standard error message (use overridingErrorMessage before contains to set your own message). + Assertions.assertThat(actual.getSwitch()).doesNotContain(expectedSwitch); + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords has no switch. + * @return this assertion object. + * @throws AssertionError if the actual Keywords's switch is not empty. + * @throws java.io.IOException if actual.getSwitch() throws one. + */ + public S hasNoSwitch() throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // we override the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting :\n <%s>\nnot to have switch but had :\n <%s>"; + + // check that it is not empty + if (actual.getSwitch().length > 0) { + failWithMessage(assertjErrorMessage, actual, java.util.Arrays.toString(actual.getSwitch())); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's switch is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's switch is not null. + * @throws java.io.IOException if actual.getSwitch() throws one. + */ + public S hasNullSwitch() throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting switch of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String[] actualSwitch = actual.getSwitch(); + if (actualSwitch != null) { + failWithMessage(assertjErrorMessage, actual, actualSwitch); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's switch is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's switch is null. + * @throws java.io.IOException if actual.getSwitch() throws one. + */ + public S hasNotNullSwitch() throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting switch of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String[] actualSwitch = actual.getSwitch(); + if (actualSwitch == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's synchronized is equal to the given one. + * @param expectedSynchronized the given synchronized to compare the actual Keywords's synchronized to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's synchronized is not equal to the given one. + */ + public S hasSynchronized(Object expectedSynchronized) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting synchronized of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualSynchronized = actual.getSynchronized(); + if (!Objects.areEqual(actualSynchronized, expectedSynchronized)) { + failWithMessage(assertjErrorMessage, actual, expectedSynchronized, actualSynchronized); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's synchronized is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's synchronized is not null. + */ + public S hasNullSynchronized() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting synchronized of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualSynchronized = actual.getSynchronized(); + if (actualSynchronized != null) { + failWithMessage(assertjErrorMessage, actual, actualSynchronized); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's synchronized is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's synchronized is null. + */ + public S hasNotNullSynchronized() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting synchronized of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualSynchronized = actual.getSynchronized(); + if (actualSynchronized == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's this is equal to the given one. + * @param expectedThis the given this to compare the actual Keywords's this to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's this is not equal to the given one. + */ + public S hasThis(Object expectedThis) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting this of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualThis = actual.getThis(); + if (!Objects.areEqual(actualThis, expectedThis)) { + failWithMessage(assertjErrorMessage, actual, expectedThis, actualThis); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's this is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's this is not null. + */ + public S hasNullThis() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting this of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualThis = actual.getThis(); + if (actualThis != null) { + failWithMessage(assertjErrorMessage, actual, actualThis); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's this is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's this is null. + */ + public S hasNotNullThis() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting this of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualThis = actual.getThis(); + if (actualThis == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's throw is equal to the given one. + * @param expectedThrow the given throw to compare the actual Keywords's throw to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's throw is not equal to the given one. + */ + public S hasThrow(Object expectedThrow) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting throw of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualThrow = actual.getThrow(); + if (!Objects.areEqual(actualThrow, expectedThrow)) { + failWithMessage(assertjErrorMessage, actual, expectedThrow, actualThrow); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's throw is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's throw is not null. + */ + public S hasNullThrow() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting throw of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualThrow = actual.getThrow(); + if (actualThrow != null) { + failWithMessage(assertjErrorMessage, actual, actualThrow); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's throw is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's throw is null. + */ + public S hasNotNullThrow() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting throw of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualThrow = actual.getThrow(); + if (actualThrow == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's throws is equal to the given one. + * @param expectedThrows the given throws to compare the actual Keywords's throws to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's throws is not equal to the given one. + */ + public S hasThrows(Object expectedThrows) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting throws of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualThrows = actual.getThrows(); + if (!Objects.areEqual(actualThrows, expectedThrows)) { + failWithMessage(assertjErrorMessage, actual, expectedThrows, actualThrows); } // return the current assertion for method chaining @@ -1382,110 +3282,110 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError if the actual Keywords's switch does not contain all given String elements. - * @throws java.io.IOException if actual.getSwitch() throws one. + * @throws AssertionError - if the actual Keywords's throws is not null. */ - public S hasSwitch(String... expectedSwitch) throws java.io.IOException { + public S hasNullThrows() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); - // check that given String varargs is not null. - if (expectedSwitch == null) failWithMessage("Expecting switch parameter not to be null."); + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting throws of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // check with standard error message (use overridingErrorMessage before contains to set your own message). - Assertions.assertThat(actual.getSwitch()).contains(expectedSwitch); + // check + Object actualThrows = actual.getThrows(); + if (actualThrows != null) { + failWithMessage(assertjErrorMessage, actual, actualThrows); + } // return the current assertion for method chaining return myself; } /** - * Verifies that the actual Keywords's switch contains only the given String elements and nothing else in whatever order. - * - * @param expectedSwitch the given elements that should be contained in actual Keywords's switch. + * Verifies that the actual Keywords's throws is not null. * @return this assertion object. - * @throws AssertionError if the actual Keywords's switch does not contain all given String elements and nothing else. - * @throws java.io.IOException if actual.getSwitch() throws one. + * @throws AssertionError - if the actual Keywords's throws is null. */ - public S hasOnlySwitch(String... expectedSwitch) throws java.io.IOException { + public S hasNotNullThrows() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); - // check that given String varargs is not null. - if (expectedSwitch == null) failWithMessage("Expecting switch parameter not to be null."); + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting throws of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // check with standard error message (use overridingErrorMessage before contains to set your own message). - Assertions.assertThat(actual.getSwitch()).containsOnly(expectedSwitch); + // check + Object actualThrows = actual.getThrows(); + if (actualThrows == null) { + failWithMessage(assertjErrorMessage, actual); + } // return the current assertion for method chaining return myself; } /** - * Verifies that the actual Keywords's switch does not contain the given String elements. - * - * @param expectedSwitch the given elements that should not be in actual Keywords's switch. + * Verifies that the actual Keywords's transient is equal to the given one. + * @param expectedTransient the given transient to compare the actual Keywords's transient to. * @return this assertion object. - * @throws AssertionError if the actual Keywords's switch contains any given String elements. - * @throws java.io.IOException if actual.getSwitch() throws one. + * @throws AssertionError - if the actual Keywords's transient is not equal to the given one. */ - public S doesNotHaveSwitch(String... expectedSwitch) throws java.io.IOException { + public S hasTransient(Object expectedTransient) { // check that actual Keywords we want to make assertions on is not null. isNotNull(); - // check that given String varargs is not null. - if (expectedSwitch == null) failWithMessage("Expecting switch parameter not to be null."); + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting transient of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; - // check with standard error message (use overridingErrorMessage before contains to set your own message). - Assertions.assertThat(actual.getSwitch()).doesNotContain(expectedSwitch); + // null safe check + Object actualTransient = actual.getTransient(); + if (!Objects.areEqual(actualTransient, expectedTransient)) { + failWithMessage(assertjErrorMessage, actual, expectedTransient, actualTransient); + } // return the current assertion for method chaining return myself; } /** - * Verifies that the actual Keywords has no switch. + * Verifies that the actual Keywords's transient is null. * @return this assertion object. - * @throws AssertionError if the actual Keywords's switch is not empty. - * @throws java.io.IOException if actual.getSwitch() throws one. + * @throws AssertionError - if the actual Keywords's transient is not null. */ - public S hasNoSwitch() throws java.io.IOException { + public S hasNullTransient() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); - // we override the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting :\n <%s>\nnot to have switch but had :\n <%s>"; + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting transient of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // check that it is not empty - if (actual.getSwitch().length > 0) { - failWithMessage(assertjErrorMessage, actual, java.util.Arrays.toString(actual.getSwitch())); + // check + Object actualTransient = actual.getTransient(); + if (actualTransient != null) { + failWithMessage(assertjErrorMessage, actual, actualTransient); } // return the current assertion for method chaining return myself; } - /** - * Verifies that the actual Keywords's synchronized is equal to the given one. - * @param expectedSynchronized the given synchronized to compare the actual Keywords's synchronized to. + * Verifies that the actual Keywords's transient is not null. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's synchronized is not equal to the given one. + * @throws AssertionError - if the actual Keywords's transient is null. */ - public S hasSynchronized(Object expectedSynchronized) { + public S hasNotNullTransient() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting synchronized of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting transient of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // null safe check - Object actualSynchronized = actual.getSynchronized(); - if (!Objects.areEqual(actualSynchronized, expectedSynchronized)) { - failWithMessage(assertjErrorMessage, actual, expectedSynchronized, actualSynchronized); + // check + Object actualTransient = actual.getTransient(); + if (actualTransient == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -1493,22 +3393,22 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's throw is not equal to the given one. + * @throws AssertionError - if the actual Keywords's true is not null. */ - public S hasThrow(Object expectedThrow) { + public S hasNullTrue() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting throw of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting true of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // null safe check - Object actualThrow = actual.getThrow(); - if (!Objects.areEqual(actualThrow, expectedThrow)) { - failWithMessage(assertjErrorMessage, actual, expectedThrow, actualThrow); + // check + Object actualTrue = actual.getTrue(); + if (actualTrue != null) { + failWithMessage(assertjErrorMessage, actual, actualTrue); } // return the current assertion for method chaining @@ -1539,22 +3438,21 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's throws is not equal to the given one. + * @throws AssertionError - if the actual Keywords's true is null. */ - public S hasThrows(Object expectedThrows) { + public S hasNotNullTrue() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting throws of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting true of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // null safe check - Object actualThrows = actual.getThrows(); - if (!Objects.areEqual(actualThrows, expectedThrows)) { - failWithMessage(assertjErrorMessage, actual, expectedThrows, actualThrows); + // check + Object actualTrue = actual.getTrue(); + if (actualTrue == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -1562,22 +3460,22 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's true is not equal to the given one. + * @throws AssertionError - if the actual Keywords's try is not null. */ - public S hasTrue(Object expectedTrue) { + public S hasNullTry() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting true of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting try of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // null safe check - Object actualTrue = actual.getTrue(); - if (!Objects.areEqual(actualTrue, expectedTrue)) { - failWithMessage(assertjErrorMessage, actual, expectedTrue, actualTrue); + // check + Object actualTry = actual.getTry(); + if (actualTry != null) { + failWithMessage(assertjErrorMessage, actual, actualTry); } // return the current assertion for method chaining @@ -1608,22 +3505,21 @@ public abstract class AbstractKeywordsAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's try is not equal to the given one. + * @throws AssertionError - if the actual Keywords's try is null. */ - public S hasTry(Object expectedTry) { + public S hasNotNullTry() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting try of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting try of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // null safe check + // check Object actualTry = actual.getTry(); - if (!Objects.areEqual(actualTry, expectedTry)) { - failWithMessage(assertjErrorMessage, actual, expectedTry, actualTry); + if (actualTry == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -1653,6 +3549,50 @@ public abstract class AbstractKeywordsAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's void is not null. + */ + public S hasNullVoid() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting void of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Void actualVoid = actual.getVoid(); + if (actualVoid != null) { + failWithMessage(assertjErrorMessage, actual, actualVoid); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's void is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's void is null. + */ + public S hasNotNullVoid() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting void of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Void actualVoid = actual.getVoid(); + if (actualVoid == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Keywords's volatile is equal to the given one. * @param expectedVolatile the given volatile to compare the actual Keywords's volatile to. @@ -1676,6 +3616,50 @@ public abstract class AbstractKeywordsAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's volatile is not null. + */ + public S hasNullVolatile() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting volatile of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualVolatile = actual.getVolatile(); + if (actualVolatile != null) { + failWithMessage(assertjErrorMessage, actual, actualVolatile); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's volatile is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's volatile is null. + */ + public S hasNotNullVolatile() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting volatile of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualVolatile = actual.getVolatile(); + if (actualVolatile == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Keywords's while is equal to the given one. * @param expectedWhile the given while to compare the actual Keywords's while to. @@ -1699,4 +3683,48 @@ public abstract class AbstractKeywordsAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's while is not null. + */ + public S hasNullWhile() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting while of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualWhile = actual.getWhile(); + if (actualWhile != null) { + failWithMessage(assertjErrorMessage, actual, actualWhile); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Keywords's while is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's while is null. + */ + public S hasNotNullWhile() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting while of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualWhile = actual.getWhile(); + if (actualWhile == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + } diff --git a/src/test/resources/AbstractMovieAssert.expected.txt b/src/test/resources/AbstractMovieAssert.expected.txt index b1e7c7ae..f3220e08 100644 --- a/src/test/resources/AbstractMovieAssert.expected.txt +++ b/src/test/resources/AbstractMovieAssert.expected.txt @@ -41,6 +41,50 @@ public abstract class AbstractMovieAssert, A return myself; } + /** + * Verifies that the actual Movie's publicCategory is null. + * @return this assertion object. + * @throws AssertionError - if the actual Movie's publicCategory is not null. + */ + public S hasNullPublicCategory() { + // check that actual Movie we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting publicCategory of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Movie.PublicCategory actualPublicCategory = actual.getPublicCategory(); + if (actualPublicCategory != null) { + failWithMessage(assertjErrorMessage, actual, actualPublicCategory); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Movie's publicCategory is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Movie's publicCategory is null. + */ + public S hasNotNullPublicCategory() { + // check that actual Movie we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting publicCategory of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Movie.PublicCategory actualPublicCategory = actual.getPublicCategory(); + if (actualPublicCategory == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Movie's releaseDate is equal to the given one. * @param releaseDate the given releaseDate to compare the actual Movie's releaseDate to. @@ -64,6 +108,50 @@ public abstract class AbstractMovieAssert, A return myself; } + /** + * Verifies that the actual Movie's releaseDate is null. + * @return this assertion object. + * @throws AssertionError - if the actual Movie's releaseDate is not null. + */ + public S hasNullReleaseDate() { + // check that actual Movie we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting releaseDate of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.Date actualReleaseDate = actual.getReleaseDate(); + if (actualReleaseDate != null) { + failWithMessage(assertjErrorMessage, actual, actualReleaseDate); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Movie's releaseDate is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Movie's releaseDate is null. + */ + public S hasNotNullReleaseDate() { + // check that actual Movie we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting releaseDate of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.Date actualReleaseDate = actual.getReleaseDate(); + if (actualReleaseDate == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Movie's producer is equal to the given one. * @param producer the given producer to compare the actual Movie's producer to. @@ -87,6 +175,50 @@ public abstract class AbstractMovieAssert, A return myself; } + /** + * Verifies that the actual Movie's producer is null. + * @return this assertion object. + * @throws AssertionError - if the actual Movie's producer is not null. + */ + public S hasNullProducer() { + // check that actual Movie we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting producer of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualProducer = actual.producer; + if (actualProducer != null) { + failWithMessage(assertjErrorMessage, actual, actualProducer); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Movie's producer is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Movie's producer is null. + */ + public S hasNotNullProducer() { + // check that actual Movie we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting producer of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualProducer = actual.producer; + if (actualProducer == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Movie's rating is equal to the given one. * @param rating the given rating to compare the actual Movie's rating to. diff --git a/src/test/resources/AbstractNameAssert.expected.txt b/src/test/resources/AbstractNameAssert.expected.txt index 646f6917..ee20a578 100644 --- a/src/test/resources/AbstractNameAssert.expected.txt +++ b/src/test/resources/AbstractNameAssert.expected.txt @@ -40,6 +40,50 @@ public abstract class AbstractNameAssert, A e return myself; } + /** + * Verifies that the actual Name's first is null. + * @return this assertion object. + * @throws AssertionError - if the actual Name's first is not null. + */ + public S hasNullFirst() { + // check that actual Name we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting first of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualFirst = actual.getFirst(); + if (actualFirst != null) { + failWithMessage(assertjErrorMessage, actual, actualFirst); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Name's first is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Name's first is null. + */ + public S hasNotNullFirst() { + // check that actual Name we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting first of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualFirst = actual.getFirst(); + if (actualFirst == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Name's last is equal to the given one. * @param last the given last to compare the actual Name's last to. @@ -63,4 +107,48 @@ public abstract class AbstractNameAssert, A e return myself; } + /** + * Verifies that the actual Name's last is null. + * @return this assertion object. + * @throws AssertionError - if the actual Name's last is not null. + */ + public S hasNullLast() { + // check that actual Name we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting last of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualLast = actual.getLast(); + if (actualLast != null) { + failWithMessage(assertjErrorMessage, actual, actualLast); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Name's last is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Name's last is null. + */ + public S hasNotNullLast() { + // check that actual Name we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting last of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualLast = actual.getLast(); + if (actualLast == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + } diff --git a/src/test/resources/AbstractPlayerAgentAssert.expected.txt b/src/test/resources/AbstractPlayerAgentAssert.expected.txt index 01533540..7a49b0b1 100644 --- a/src/test/resources/AbstractPlayerAgentAssert.expected.txt +++ b/src/test/resources/AbstractPlayerAgentAssert.expected.txt @@ -40,4 +40,48 @@ public abstract class AbstractPlayerAgentAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual PlayerAgent's managedPlayer is not null. + */ + public S hasNullManagedPlayer() { + // check that actual PlayerAgent we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting managedPlayer of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Player actualManagedPlayer = actual.getManagedPlayer(); + if (actualManagedPlayer != null) { + failWithMessage(assertjErrorMessage, actual, actualManagedPlayer); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual PlayerAgent's managedPlayer is not null. + * @return this assertion object. + * @throws AssertionError - if the actual PlayerAgent's managedPlayer is null. + */ + public S hasNotNullManagedPlayer() { + // check that actual PlayerAgent we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting managedPlayer of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Player actualManagedPlayer = actual.getManagedPlayer(); + if (actualManagedPlayer == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + } diff --git a/src/test/resources/AbstractPlayerAgentAssert.generated.in.custom.package.expected.txt b/src/test/resources/AbstractPlayerAgentAssert.generated.in.custom.package.expected.txt index f5adbfbf..7d86bafa 100644 --- a/src/test/resources/AbstractPlayerAgentAssert.generated.in.custom.package.expected.txt +++ b/src/test/resources/AbstractPlayerAgentAssert.generated.in.custom.package.expected.txt @@ -41,4 +41,48 @@ public abstract class AbstractPlayerAgentAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual PlayerAgent's managedPlayer is not null. + */ + public S hasNullManagedPlayer() { + // check that actual PlayerAgent we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting managedPlayer of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + org.assertj.assertions.generator.data.nba.Player actualManagedPlayer = actual.getManagedPlayer(); + if (actualManagedPlayer != null) { + failWithMessage(assertjErrorMessage, actual, actualManagedPlayer); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual PlayerAgent's managedPlayer is not null. + * @return this assertion object. + * @throws AssertionError - if the actual PlayerAgent's managedPlayer is null. + */ + public S hasNotNullManagedPlayer() { + // check that actual PlayerAgent we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting managedPlayer of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + org.assertj.assertions.generator.data.nba.Player actualManagedPlayer = actual.getManagedPlayer(); + if (actualManagedPlayer == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + } diff --git a/src/test/resources/AbstractPlayerAssert.expected.txt b/src/test/resources/AbstractPlayerAssert.expected.txt index e5794328..2337f3a5 100644 --- a/src/test/resources/AbstractPlayerAssert.expected.txt +++ b/src/test/resources/AbstractPlayerAssert.expected.txt @@ -137,6 +137,50 @@ public abstract class AbstractPlayerAssert, return myself; } + /** + * Verifies that the actual Player's name is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's name is not null. + */ + public S hasNullName() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + org.assertj.assertions.generator.data.Name actualName = actual.getName(); + if (actualName != null) { + failWithMessage(assertjErrorMessage, actual, actualName); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Player's name is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's name is null. + */ + public S hasNotNullName() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + org.assertj.assertions.generator.data.Name actualName = actual.getName(); + if (actualName == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Player should not play. * @return this assertion object. @@ -325,6 +369,49 @@ public abstract class AbstractPlayerAssert, return myself; } + /** + * Verifies that the actual Player's points is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's points is not null. + */ + public S hasNullPoints() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting points of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualPoints = actual.getPoints(); + if (actualPoints != null) { + failWithMessage(assertjErrorMessage, actual, actualPoints); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Player's points is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's points is null. + */ + public S hasNotNullPoints() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting points of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualPoints = actual.getPoints(); + if (actualPoints == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } /** * Verifies that the actual Player's pointsPerGame is equal to the given one. @@ -432,6 +519,49 @@ public abstract class AbstractPlayerAssert, return myself; } + /** + * Verifies that the actual Player's previousTeamNames is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's previousTeamNames is not null. + */ + public S hasNullPreviousTeamNames() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting previousTeamNames of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String[] actualPreviousTeamNames = actual.getPreviousTeamNames(); + if (actualPreviousTeamNames != null) { + failWithMessage(assertjErrorMessage, actual, actualPreviousTeamNames); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Player's previousTeamNames is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's previousTeamNames is null. + */ + public S hasNotNullPreviousTeamNames() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting previousTeamNames of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String[] actualPreviousTeamNames = actual.getPreviousTeamNames(); + if (actualPreviousTeamNames == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } /** * Verifies that the actual Player's reboundsPerGame is equal to the given one. @@ -600,6 +730,50 @@ public abstract class AbstractPlayerAssert, return myself; } + /** + * Verifies that the actual Player's team is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's team is not null. + */ + public S hasNullTeam() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting team of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualTeam = actual.getTeam(); + if (actualTeam != null) { + failWithMessage(assertjErrorMessage, actual, actualTeam); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Player's team is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's team is null. + */ + public S hasNotNullTeam() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting team of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualTeam = actual.getTeam(); + if (actualTeam == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Player's teamMates contains the given Player elements. * @param teamMates the given elements that should be contained in actual Player's teamMates. @@ -752,6 +926,49 @@ public abstract class AbstractPlayerAssert, return myself; } + /** + * Verifies that the actual Player's teamMates is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's teamMates is not null. + */ + public S hasNullTeamMates() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting teamMates of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualTeamMates = actual.getTeamMates(); + if (actualTeamMates != null) { + failWithMessage(assertjErrorMessage, actual, actualTeamMates); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Player's teamMates is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's teamMates is null. + */ + public S hasNotNullTeamMates() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting teamMates of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualTeamMates = actual.getTeamMates(); + if (actualTeamMates == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } /** * Verifies that the actual Player has trophy. @@ -1049,5 +1266,48 @@ public abstract class AbstractPlayerAssert, return myself; } + /** + * Verifies that the actual Player's previousTeams is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's previousTeams is not null. + */ + public S hasNullPreviousTeams() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting previousTeams of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualPreviousTeams = actual.previousTeams; + if (actualPreviousTeams != null) { + failWithMessage(assertjErrorMessage, actual, actualPreviousTeams); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Player's previousTeams is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's previousTeams is null. + */ + public S hasNotNullPreviousTeams() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting previousTeams of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualPreviousTeams = actual.previousTeams; + if (actualPreviousTeams == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } } diff --git a/src/test/resources/AbstractPlayerAssert.generated.in.custom.package.expected.txt b/src/test/resources/AbstractPlayerAssert.generated.in.custom.package.expected.txt index 08c50190..e3720d0f 100644 --- a/src/test/resources/AbstractPlayerAssert.generated.in.custom.package.expected.txt +++ b/src/test/resources/AbstractPlayerAssert.generated.in.custom.package.expected.txt @@ -138,6 +138,50 @@ public abstract class AbstractPlayerAssert, return myself; } + /** + * Verifies that the actual Player's name is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's name is not null. + */ + public S hasNullName() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + org.assertj.assertions.generator.data.Name actualName = actual.getName(); + if (actualName != null) { + failWithMessage(assertjErrorMessage, actual, actualName); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Player's name is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's name is null. + */ + public S hasNotNullName() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + org.assertj.assertions.generator.data.Name actualName = actual.getName(); + if (actualName == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Player should not play. * @return this assertion object. @@ -326,6 +370,49 @@ public abstract class AbstractPlayerAssert, return myself; } + /** + * Verifies that the actual Player's points is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's points is not null. + */ + public S hasNullPoints() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting points of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualPoints = actual.getPoints(); + if (actualPoints != null) { + failWithMessage(assertjErrorMessage, actual, actualPoints); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Player's points is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's points is null. + */ + public S hasNotNullPoints() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting points of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualPoints = actual.getPoints(); + if (actualPoints == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } /** * Verifies that the actual Player's pointsPerGame is equal to the given one. @@ -433,6 +520,49 @@ public abstract class AbstractPlayerAssert, return myself; } + /** + * Verifies that the actual Player's previousTeamNames is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's previousTeamNames is not null. + */ + public S hasNullPreviousTeamNames() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting previousTeamNames of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String[] actualPreviousTeamNames = actual.getPreviousTeamNames(); + if (actualPreviousTeamNames != null) { + failWithMessage(assertjErrorMessage, actual, actualPreviousTeamNames); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Player's previousTeamNames is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's previousTeamNames is null. + */ + public S hasNotNullPreviousTeamNames() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting previousTeamNames of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String[] actualPreviousTeamNames = actual.getPreviousTeamNames(); + if (actualPreviousTeamNames == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } /** * Verifies that the actual Player's reboundsPerGame is equal to the given one. @@ -601,6 +731,50 @@ public abstract class AbstractPlayerAssert, return myself; } + /** + * Verifies that the actual Player's team is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's team is not null. + */ + public S hasNullTeam() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting team of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualTeam = actual.getTeam(); + if (actualTeam != null) { + failWithMessage(assertjErrorMessage, actual, actualTeam); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Player's team is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's team is null. + */ + public S hasNotNullTeam() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting team of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualTeam = actual.getTeam(); + if (actualTeam == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Player's teamMates contains the given Player elements. * @param teamMates the given elements that should be contained in actual Player's teamMates. @@ -753,6 +927,49 @@ public abstract class AbstractPlayerAssert, return myself; } + /** + * Verifies that the actual Player's teamMates is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's teamMates is not null. + */ + public S hasNullTeamMates() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting teamMates of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualTeamMates = actual.getTeamMates(); + if (actualTeamMates != null) { + failWithMessage(assertjErrorMessage, actual, actualTeamMates); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Player's teamMates is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's teamMates is null. + */ + public S hasNotNullTeamMates() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting teamMates of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualTeamMates = actual.getTeamMates(); + if (actualTeamMates == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } /** * Verifies that the actual Player has trophy. @@ -1050,5 +1267,48 @@ public abstract class AbstractPlayerAssert, return myself; } + /** + * Verifies that the actual Player's previousTeams is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's previousTeams is not null. + */ + public S hasNullPreviousTeams() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting previousTeams of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualPreviousTeams = actual.previousTeams; + if (actualPreviousTeams != null) { + failWithMessage(assertjErrorMessage, actual, actualPreviousTeams); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Player's previousTeams is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's previousTeams is null. + */ + public S hasNotNullPreviousTeams() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting previousTeams of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualPreviousTeams = actual.previousTeams; + if (actualPreviousTeams == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } } diff --git a/src/test/resources/AbstractPrimitivesAssert.expected.txt b/src/test/resources/AbstractPrimitivesAssert.expected.txt index e6a113a1..5c742f18 100644 --- a/src/test/resources/AbstractPrimitivesAssert.expected.txt +++ b/src/test/resources/AbstractPrimitivesAssert.expected.txt @@ -136,6 +136,50 @@ public abstract class AbstractPrimitivesAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's byteWrapper is not null. + */ + public S hasNullByteWrapper() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting byteWrapper of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Byte actualByteWrapper = actual.getByteWrapper(); + if (actualByteWrapper != null) { + failWithMessage(assertjErrorMessage, actual, actualByteWrapper); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Primitives's byteWrapper is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's byteWrapper is null. + */ + public S hasNotNullByteWrapper() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting byteWrapper of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Byte actualByteWrapper = actual.getByteWrapper(); + if (actualByteWrapper == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Primitives's char is equal to the given one. * @param expectedChar the given char to compare the actual Primitives's char to. @@ -182,6 +226,50 @@ public abstract class AbstractPrimitivesAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's character is not null. + */ + public S hasNullCharacter() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting character of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Character actualCharacter = actual.getCharacter(); + if (actualCharacter != null) { + failWithMessage(assertjErrorMessage, actual, actualCharacter); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Primitives's character is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's character is null. + */ + public S hasNotNullCharacter() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting character of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Character actualCharacter = actual.getCharacter(); + if (actualCharacter == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Primitives's double is equal to the given one. * @param expectedDouble the given double to compare the actual Primitives's double to. @@ -280,6 +368,50 @@ public abstract class AbstractPrimitivesAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's doubleWrapper is not null. + */ + public S hasNullDoubleWrapper() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting doubleWrapper of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Double actualDoubleWrapper = actual.getDoubleWrapper(); + if (actualDoubleWrapper != null) { + failWithMessage(assertjErrorMessage, actual, actualDoubleWrapper); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Primitives's doubleWrapper is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's doubleWrapper is null. + */ + public S hasNotNullDoubleWrapper() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting doubleWrapper of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Double actualDoubleWrapper = actual.getDoubleWrapper(); + if (actualDoubleWrapper == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Primitives is enabled. * @return this assertion object. @@ -414,6 +546,50 @@ public abstract class AbstractPrimitivesAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's floatWrapper is not null. + */ + public S hasNullFloatWrapper() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting floatWrapper of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Float actualFloatWrapper = actual.getFloatWrapper(); + if (actualFloatWrapper != null) { + failWithMessage(assertjErrorMessage, actual, actualFloatWrapper); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Primitives's floatWrapper is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's floatWrapper is null. + */ + public S hasNotNullFloatWrapper() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting floatWrapper of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Float actualFloatWrapper = actual.getFloatWrapper(); + if (actualFloatWrapper == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Primitives's int is equal to the given one. * @param expectedInt the given int to compare the actual Primitives's int to. @@ -460,6 +636,50 @@ public abstract class AbstractPrimitivesAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's integer is not null. + */ + public S hasNullInteger() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting integer of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Integer actualInteger = actual.getInteger(); + if (actualInteger != null) { + failWithMessage(assertjErrorMessage, actual, actualInteger); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Primitives's integer is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's integer is null. + */ + public S hasNotNullInteger() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting integer of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Integer actualInteger = actual.getInteger(); + if (actualInteger == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Primitives's long is equal to the given one. * @param expectedLong the given long to compare the actual Primitives's long to. @@ -506,6 +726,50 @@ public abstract class AbstractPrimitivesAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's longWrapper is not null. + */ + public S hasNullLongWrapper() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting longWrapper of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Long actualLongWrapper = actual.getLongWrapper(); + if (actualLongWrapper != null) { + failWithMessage(assertjErrorMessage, actual, actualLongWrapper); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Primitives's longWrapper is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's longWrapper is null. + */ + public S hasNotNullLongWrapper() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting longWrapper of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Long actualLongWrapper = actual.getLongWrapper(); + if (actualLongWrapper == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Primitives's short is equal to the given one. * @param expectedShort the given short to compare the actual Primitives's short to. @@ -552,4 +816,48 @@ public abstract class AbstractPrimitivesAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's shortWrapper is not null. + */ + public S hasNullShortWrapper() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting shortWrapper of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Short actualShortWrapper = actual.getShortWrapper(); + if (actualShortWrapper != null) { + failWithMessage(assertjErrorMessage, actual, actualShortWrapper); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Primitives's shortWrapper is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's shortWrapper is null. + */ + public S hasNotNullShortWrapper() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting shortWrapper of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Short actualShortWrapper = actual.getShortWrapper(); + if (actualShortWrapper == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + } diff --git a/src/test/resources/AbstractTeamAssert.expected.txt b/src/test/resources/AbstractTeamAssert.expected.txt index 2c16b771..bd864ff0 100644 --- a/src/test/resources/AbstractTeamAssert.expected.txt +++ b/src/test/resources/AbstractTeamAssert.expected.txt @@ -42,6 +42,50 @@ public abstract class AbstractTeamAssert, A e return myself; } + /** + * Verifies that the actual Team's division is null. + * @return this assertion object. + * @throws AssertionError - if the actual Team's division is not null. + */ + public S hasNullDivision() { + // check that actual Team we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting division of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualDivision = actual.getDivision(); + if (actualDivision != null) { + failWithMessage(assertjErrorMessage, actual, actualDivision); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Team's division is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Team's division is null. + */ + public S hasNotNullDivision() { + // check that actual Team we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting division of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualDivision = actual.getDivision(); + if (actualDivision == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Team's name is equal to the given one. * @param name the given name to compare the actual Team's name to. @@ -65,6 +109,50 @@ public abstract class AbstractTeamAssert, A e return myself; } + /** + * Verifies that the actual Team's name is null. + * @return this assertion object. + * @throws AssertionError - if the actual Team's name is not null. + */ + public S hasNullName() { + // check that actual Team we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualName = actual.name; + if (actualName != null) { + failWithMessage(assertjErrorMessage, actual, actualName); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Team's name is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Team's name is null. + */ + public S hasNotNullName() { + // check that actual Team we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualName = actual.name; + if (actualName == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual Team's oldNames contains the given String elements. * @param oldNames the given elements that should be contained in actual Team's oldNames. @@ -148,6 +236,49 @@ public abstract class AbstractTeamAssert, A e return myself; } + /** + * Verifies that the actual Team's oldNames is null. + * @return this assertion object. + * @throws AssertionError - if the actual Team's oldNames is not null. + */ + public S hasNullOldNames() { + // check that actual Team we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting oldNames of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String[] actualOldNames = actual.oldNames; + if (actualOldNames != null) { + failWithMessage(assertjErrorMessage, actual, actualOldNames); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Team's oldNames is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Team's oldNames is null. + */ + public S hasNotNullOldNames() { + // check that actual Team we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting oldNames of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String[] actualOldNames = actual.oldNames; + if (actualOldNames == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } /** * Verifies that the actual Team's players contains the given org.assertj.assertions.generator.data.nba.Player elements. @@ -301,6 +432,49 @@ public abstract class AbstractTeamAssert, A e return myself; } + /** + * Verifies that the actual Team's players is null. + * @return this assertion object. + * @throws AssertionError - if the actual Team's players is not null. + */ + public S hasNullPlayers() { + // check that actual Team we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting players of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualPlayers = actual.players; + if (actualPlayers != null) { + failWithMessage(assertjErrorMessage, actual, actualPlayers); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Team's players is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Team's players is null. + */ + public S hasNotNullPlayers() { + // check that actual Team we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting players of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualPlayers = actual.players; + if (actualPlayers == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } /** * Verifies that the actual Team's points contains the given int[] elements. @@ -454,6 +628,49 @@ public abstract class AbstractTeamAssert, A e return myself; } + /** + * Verifies that the actual Team's points is null. + * @return this assertion object. + * @throws AssertionError - if the actual Team's points is not null. + */ + public S hasNullPoints() { + // check that actual Team we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting points of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualPoints = actual.points; + if (actualPoints != null) { + failWithMessage(assertjErrorMessage, actual, actualPoints); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual Team's points is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Team's points is null. + */ + public S hasNotNullPoints() { + // check that actual Team we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting points of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualPoints = actual.points; + if (actualPoints == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } /** * Verifies that the actual Team's rank is equal to the given one. diff --git a/src/test/resources/AbstractWithPrivateFieldsAssert.expected.txt b/src/test/resources/AbstractWithPrivateFieldsAssert.expected.txt index fd212860..df857135 100644 --- a/src/test/resources/AbstractWithPrivateFieldsAssert.expected.txt +++ b/src/test/resources/AbstractWithPrivateFieldsAssert.expected.txt @@ -39,6 +39,50 @@ public abstract class AbstractWithPrivateFieldsAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual WithPrivateFields's address is not null. + */ + public S hasNullAddress() { + // check that actual WithPrivateFields we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting address of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualAddress = actual.getAddress(); + if (actualAddress != null) { + failWithMessage(assertjErrorMessage, actual, actualAddress); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual WithPrivateFields's address is not null. + * @return this assertion object. + * @throws AssertionError - if the actual WithPrivateFields's address is null. + */ + public S hasNotNullAddress() { + // check that actual WithPrivateFields we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting address of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualAddress = actual.getAddress(); + if (actualAddress == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual WithPrivateFields's age is equal to the given one. * @param age the given age to compare the actual WithPrivateFields's age to. @@ -121,6 +165,50 @@ public abstract class AbstractWithPrivateFieldsAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual WithPrivateFields's name is not null. + */ + public S hasNullName() { + // check that actual WithPrivateFields we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualName = org.assertj.core.util.introspection.FieldSupport.EXTRACTION.fieldValue("name", String.class, actual); + if (actualName != null) { + failWithMessage(assertjErrorMessage, actual, actualName); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual WithPrivateFields's name is not null. + * @return this assertion object. + * @throws AssertionError - if the actual WithPrivateFields's name is null. + */ + public S hasNotNullName() { + // check that actual WithPrivateFields we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualName = org.assertj.core.util.introspection.FieldSupport.EXTRACTION.fieldValue("name", String.class, actual); + if (actualName == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual WithPrivateFields's nickname is equal to the given one. * @param nickname the given nickname to compare the actual WithPrivateFields's nickname to. @@ -144,4 +232,48 @@ public abstract class AbstractWithPrivateFieldsAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual WithPrivateFields's nickname is not null. + */ + public S hasNullNickname() { + // check that actual WithPrivateFields we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting nickname of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualNickname = org.assertj.core.util.introspection.FieldSupport.EXTRACTION.fieldValue("nickname", String.class, actual); + if (actualNickname != null) { + failWithMessage(assertjErrorMessage, actual, actualNickname); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual WithPrivateFields's nickname is not null. + * @return this assertion object. + * @throws AssertionError - if the actual WithPrivateFields's nickname is null. + */ + public S hasNotNullNickname() { + // check that actual WithPrivateFields we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting nickname of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualNickname = org.assertj.core.util.introspection.FieldSupport.EXTRACTION.fieldValue("nickname", String.class, actual); + if (actualNickname == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + } diff --git a/src/test/resources/AbstractWithPrivateFieldsParentAssert.expected.txt b/src/test/resources/AbstractWithPrivateFieldsParentAssert.expected.txt index 3f202860..c5e0498b 100644 --- a/src/test/resources/AbstractWithPrivateFieldsParentAssert.expected.txt +++ b/src/test/resources/AbstractWithPrivateFieldsParentAssert.expected.txt @@ -40,6 +40,50 @@ public abstract class AbstractWithPrivateFieldsParentAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual WithPrivateFieldsParent's city is not null. + */ + public S hasNullCity() { + // check that actual WithPrivateFieldsParent we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting city of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualCity = actual.getCity(); + if (actualCity != null) { + failWithMessage(assertjErrorMessage, actual, actualCity); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual WithPrivateFieldsParent's city is not null. + * @return this assertion object. + * @throws AssertionError - if the actual WithPrivateFieldsParent's city is null. + */ + public S hasNotNullCity() { + // check that actual WithPrivateFieldsParent we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting city of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualCity = actual.getCity(); + if (actualCity == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual WithPrivateFieldsParent's country is equal to the given one. * @param country the given country to compare the actual WithPrivateFieldsParent's country to. @@ -63,6 +107,50 @@ public abstract class AbstractWithPrivateFieldsParentAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual WithPrivateFieldsParent's country is not null. + */ + public S hasNullCountry() { + // check that actual WithPrivateFieldsParent we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting country of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualCountry = org.assertj.core.util.introspection.FieldSupport.EXTRACTION.fieldValue("country", String.class, actual); + if (actualCountry != null) { + failWithMessage(assertjErrorMessage, actual, actualCountry); + } + + // return the current assertion for method chaining + return myself; + } + + /** + * Verifies that the actual WithPrivateFieldsParent's country is not null. + * @return this assertion object. + * @throws AssertionError - if the actual WithPrivateFieldsParent's country is null. + */ + public S hasNotNullCountry() { + // check that actual WithPrivateFieldsParent we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting country of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualCountry = org.assertj.core.util.introspection.FieldSupport.EXTRACTION.fieldValue("country", String.class, actual); + if (actualCountry == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return myself; + } + /** * Verifies that the actual WithPrivateFieldsParent is northernHemisphere. * @return this assertion object. diff --git a/src/test/resources/AnnotatedClassAssert.flat.expected.txt b/src/test/resources/AnnotatedClassAssert.flat.expected.txt index badd901b..907376da 100644 --- a/src/test/resources/AnnotatedClassAssert.flat.expected.txt +++ b/src/test/resources/AnnotatedClassAssert.flat.expected.txt @@ -51,6 +51,50 @@ public class AnnotatedClassAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual AnnotatedClass's anotherProperty is not null. + */ + public AnnotatedClassAssert hasNullAnotherProperty() { + // check that actual AnnotatedClass we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting anotherProperty of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualAnotherProperty = actual.anotherProperty(); + if (actualAnotherProperty != null) { + failWithMessage(assertjErrorMessage, actual, actualAnotherProperty); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual AnnotatedClass's anotherProperty is not null. + * @return this assertion object. + * @throws AssertionError - if the actual AnnotatedClass's anotherProperty is null. + */ + public AnnotatedClassAssert hasNotNullAnotherProperty() { + // check that actual AnnotatedClass we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting anotherProperty of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualAnotherProperty = actual.anotherProperty(); + if (actualAnotherProperty == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual AnnotatedClass's stuff is equal to the given one. * @param stuff the given stuff to compare the actual AnnotatedClass's stuff to. diff --git a/src/test/resources/AutoValueAnnotatedClassAssert.flat.expected.txt b/src/test/resources/AutoValueAnnotatedClassAssert.flat.expected.txt index b11da1ad..360c1589 100644 --- a/src/test/resources/AutoValueAnnotatedClassAssert.flat.expected.txt +++ b/src/test/resources/AutoValueAnnotatedClassAssert.flat.expected.txt @@ -51,6 +51,50 @@ public class AutoValueAnnotatedClassAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual AutoValueAnnotatedClass's anotherProperty is not null. + */ + public AutoValueAnnotatedClassAssert hasNullAnotherProperty() { + // check that actual AutoValueAnnotatedClass we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting anotherProperty of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualAnotherProperty = actual.anotherProperty(); + if (actualAnotherProperty != null) { + failWithMessage(assertjErrorMessage, actual, actualAnotherProperty); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual AutoValueAnnotatedClass's anotherProperty is not null. + * @return this assertion object. + * @throws AssertionError - if the actual AutoValueAnnotatedClass's anotherProperty is null. + */ + public AutoValueAnnotatedClassAssert hasNotNullAnotherProperty() { + // check that actual AutoValueAnnotatedClass we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting anotherProperty of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualAnotherProperty = actual.anotherProperty(); + if (actualAnotherProperty == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual AutoValueAnnotatedClass's stuff is equal to the given one. * @param stuff the given stuff to compare the actual AutoValueAnnotatedClass's stuff to. diff --git a/src/test/resources/BeanWithOneException.expected.txt b/src/test/resources/BeanWithOneException.expected.txt index 00864f11..d13ddbdb 100644 --- a/src/test/resources/BeanWithOneException.expected.txt +++ b/src/test/resources/BeanWithOneException.expected.txt @@ -117,6 +117,51 @@ public class BeanWithOneExceptionAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual BeanWithOneException's arrayPropertyThrowsException is not null. + * @throws java.io.IOException if actual.getArrayPropertyThrowsException() throws one. + */ + public BeanWithOneExceptionAssert hasNullArrayPropertyThrowsException() throws java.io.IOException { + // check that actual BeanWithOneException we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting arrayPropertyThrowsException of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String[] actualArrayPropertyThrowsException = actual.getArrayPropertyThrowsException(); + if (actualArrayPropertyThrowsException != null) { + failWithMessage(assertjErrorMessage, actual, actualArrayPropertyThrowsException); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual BeanWithOneException's arrayPropertyThrowsException is not null. + * @return this assertion object. + * @throws AssertionError - if the actual BeanWithOneException's arrayPropertyThrowsException is null. + * @throws java.io.IOException if actual.getArrayPropertyThrowsException() throws one. + */ + public BeanWithOneExceptionAssert hasNotNullArrayPropertyThrowsException() throws java.io.IOException { + // check that actual BeanWithOneException we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting arrayPropertyThrowsException of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String[] actualArrayPropertyThrowsException = actual.getArrayPropertyThrowsException(); + if (actualArrayPropertyThrowsException == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } /** * Verifies that the actual BeanWithOneException is boolean property throws exception. @@ -315,6 +360,51 @@ public class BeanWithOneExceptionAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual BeanWithOneException's iterablePropertyThrowsException is not null. + * @throws java.io.IOException if actual.getIterablePropertyThrowsException() throws one. + */ + public BeanWithOneExceptionAssert hasNullIterablePropertyThrowsException() throws java.io.IOException { + // check that actual BeanWithOneException we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting iterablePropertyThrowsException of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualIterablePropertyThrowsException = actual.getIterablePropertyThrowsException(); + if (actualIterablePropertyThrowsException != null) { + failWithMessage(assertjErrorMessage, actual, actualIterablePropertyThrowsException); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual BeanWithOneException's iterablePropertyThrowsException is not null. + * @return this assertion object. + * @throws AssertionError - if the actual BeanWithOneException's iterablePropertyThrowsException is null. + * @throws java.io.IOException if actual.getIterablePropertyThrowsException() throws one. + */ + public BeanWithOneExceptionAssert hasNotNullIterablePropertyThrowsException() throws java.io.IOException { + // check that actual BeanWithOneException we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting iterablePropertyThrowsException of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualIterablePropertyThrowsException = actual.getIterablePropertyThrowsException(); + if (actualIterablePropertyThrowsException == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } /** * Verifies that the actual BeanWithOneException's stringPropertyThrowsException is equal to the given one. @@ -340,4 +430,50 @@ public class BeanWithOneExceptionAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual BeanWithOneException's stringPropertyThrowsException is not null. + * @throws java.io.IOException if actual.getStringPropertyThrowsException() throws one. + */ + public BeanWithOneExceptionAssert hasNullStringPropertyThrowsException() throws java.io.IOException { + // check that actual BeanWithOneException we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting stringPropertyThrowsException of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualStringPropertyThrowsException = actual.getStringPropertyThrowsException(); + if (actualStringPropertyThrowsException != null) { + failWithMessage(assertjErrorMessage, actual, actualStringPropertyThrowsException); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual BeanWithOneException's stringPropertyThrowsException is not null. + * @return this assertion object. + * @throws AssertionError - if the actual BeanWithOneException's stringPropertyThrowsException is null. + * @throws java.io.IOException if actual.getStringPropertyThrowsException() throws one. + */ + public BeanWithOneExceptionAssert hasNotNullStringPropertyThrowsException() throws java.io.IOException { + // check that actual BeanWithOneException we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting stringPropertyThrowsException of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualStringPropertyThrowsException = actual.getStringPropertyThrowsException(); + if (actualStringPropertyThrowsException == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + } diff --git a/src/test/resources/ClassUsingDifferentClassesWithSameNameAssert.flat.expected.txt b/src/test/resources/ClassUsingDifferentClassesWithSameNameAssert.flat.expected.txt index 634d3dfa..fcb4ad58 100644 --- a/src/test/resources/ClassUsingDifferentClassesWithSameNameAssert.flat.expected.txt +++ b/src/test/resources/ClassUsingDifferentClassesWithSameNameAssert.flat.expected.txt @@ -51,6 +51,50 @@ public class ClassUsingDifferentClassesWithSameNameAssert extends AbstractObject return this; } + /** + * Verifies that the actual ClassUsingDifferentClassesWithSameName's nbaTeam is null. + * @return this assertion object. + * @throws AssertionError - if the actual ClassUsingDifferentClassesWithSameName's nbaTeam is not null. + */ + public ClassUsingDifferentClassesWithSameNameAssert hasNullNbaTeam() { + // check that actual ClassUsingDifferentClassesWithSameName we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting nbaTeam of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + org.assertj.assertions.generator.data.nba.team.Team actualNbaTeam = actual.getNbaTeam(); + if (actualNbaTeam != null) { + failWithMessage(assertjErrorMessage, actual, actualNbaTeam); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual ClassUsingDifferentClassesWithSameName's nbaTeam is not null. + * @return this assertion object. + * @throws AssertionError - if the actual ClassUsingDifferentClassesWithSameName's nbaTeam is null. + */ + public ClassUsingDifferentClassesWithSameNameAssert hasNotNullNbaTeam() { + // check that actual ClassUsingDifferentClassesWithSameName we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting nbaTeam of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + org.assertj.assertions.generator.data.nba.team.Team actualNbaTeam = actual.getNbaTeam(); + if (actualNbaTeam == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual ClassUsingDifferentClassesWithSameName's team is equal to the given one. * @param team the given team to compare the actual ClassUsingDifferentClassesWithSameName's team to. @@ -74,4 +118,48 @@ public class ClassUsingDifferentClassesWithSameNameAssert extends AbstractObject return this; } + /** + * Verifies that the actual ClassUsingDifferentClassesWithSameName's team is null. + * @return this assertion object. + * @throws AssertionError - if the actual ClassUsingDifferentClassesWithSameName's team is not null. + */ + public ClassUsingDifferentClassesWithSameNameAssert hasNullTeam() { + // check that actual ClassUsingDifferentClassesWithSameName we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting team of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + org.assertj.assertions.generator.data.Team actualTeam = actual.getTeam(); + if (actualTeam != null) { + failWithMessage(assertjErrorMessage, actual, actualTeam); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual ClassUsingDifferentClassesWithSameName's team is not null. + * @return this assertion object. + * @throws AssertionError - if the actual ClassUsingDifferentClassesWithSameName's team is null. + */ + public ClassUsingDifferentClassesWithSameNameAssert hasNotNullTeam() { + // check that actual ClassUsingDifferentClassesWithSameName we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting team of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + org.assertj.assertions.generator.data.Team actualTeam = actual.getTeam(); + if (actualTeam == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + } diff --git a/src/test/resources/Dollar$Assert.flat.expected.txt b/src/test/resources/Dollar$Assert.flat.expected.txt index 8a1c1ae6..ab5e0805 100644 --- a/src/test/resources/Dollar$Assert.flat.expected.txt +++ b/src/test/resources/Dollar$Assert.flat.expected.txt @@ -51,4 +51,48 @@ public class Dollar$Assert extends AbstractObjectAssert return this; } + /** + * Verifies that the actual Dollar$'s test is null. + * @return this assertion object. + * @throws AssertionError - if the actual Dollar$'s test is not null. + */ + public Dollar$Assert hasNullTest() { + // check that actual Dollar$ we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting test of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualTest = actual.test; + if (actualTest != null) { + failWithMessage(assertjErrorMessage, actual, actualTest); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Dollar$'s test is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Dollar$'s test is null. + */ + public Dollar$Assert hasNotNullTest() { + // check that actual Dollar$ we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting test of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualTest = actual.test; + if (actualTest == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + } diff --git a/src/test/resources/FieldPropertyClashAssert.flat.expected.txt b/src/test/resources/FieldPropertyClashAssert.flat.expected.txt index 570b140c..24b2672f 100644 --- a/src/test/resources/FieldPropertyClashAssert.flat.expected.txt +++ b/src/test/resources/FieldPropertyClashAssert.flat.expected.txt @@ -159,6 +159,50 @@ public class FieldPropertyClashAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual FieldPropertyClash's string is not null. + */ + public FieldPropertyClashAssert hasNullString() { + // check that actual FieldPropertyClash we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting string of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualString = actual.getString(); + if (actualString != null) { + failWithMessage(assertjErrorMessage, actual, actualString); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual FieldPropertyClash's string is not null. + * @return this assertion object. + * @throws AssertionError - if the actual FieldPropertyClash's string is null. + */ + public FieldPropertyClashAssert hasNotNullString() { + // check that actual FieldPropertyClash we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting string of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualString = actual.getString(); + if (actualString == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual FieldPropertyClash will be upside down. * @return this assertion object. @@ -218,4 +262,48 @@ public class FieldPropertyClashAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual FieldPropertyClash's actual is not null. + */ + public FieldPropertyClashAssert hasNullActual() { + // check that actual FieldPropertyClash we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting actual of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualActual = actual.actual; + if (actualActual != null) { + failWithMessage(assertjErrorMessage, actual, actualActual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual FieldPropertyClash's actual is not null. + * @return this assertion object. + * @throws AssertionError - if the actual FieldPropertyClash's actual is null. + */ + public FieldPropertyClashAssert hasNotNullActual() { + // check that actual FieldPropertyClash we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting actual of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualActual = actual.actual; + if (actualActual == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + } diff --git a/src/test/resources/KeywordsAssert.flat.expected.txt b/src/test/resources/KeywordsAssert.flat.expected.txt index 24190160..2063f932 100644 --- a/src/test/resources/KeywordsAssert.flat.expected.txt +++ b/src/test/resources/KeywordsAssert.flat.expected.txt @@ -54,6 +54,52 @@ public class KeywordsAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's abstract is not null. + * @throws java.io.IOException if actual.getAbstract() throws one. + */ + public KeywordsAssert hasNullAbstract() throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting abstract of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualAbstract = actual.getAbstract(); + if (actualAbstract != null) { + failWithMessage(assertjErrorMessage, actual, actualAbstract); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's abstract is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's abstract is null. + * @throws java.io.IOException if actual.getAbstract() throws one. + */ + public KeywordsAssert hasNotNullAbstract() throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting abstract of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualAbstract = actual.getAbstract(); + if (actualAbstract == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Keywords's assert is equal to the given one. * @param expectedAssert the given assert to compare the actual Keywords's assert to. @@ -77,6 +123,50 @@ public class KeywordsAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's assert is not null. + */ + public KeywordsAssert hasNullAssert() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting assert of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualAssert = actual.getAssert(); + if (actualAssert != null) { + failWithMessage(assertjErrorMessage, actual, actualAssert); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's assert is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's assert is null. + */ + public KeywordsAssert hasNotNullAssert() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting assert of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualAssert = actual.getAssert(); + if (actualAssert == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Keywords's boolean is equal to the given one. * @param expectedBoolean the given boolean to compare the actual Keywords's boolean to. @@ -100,6 +190,50 @@ public class KeywordsAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's boolean is not null. + */ + public KeywordsAssert hasNullBoolean() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting boolean of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Boolean actualBoolean = actual.getBoolean(); + if (actualBoolean != null) { + failWithMessage(assertjErrorMessage, actual, actualBoolean); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's boolean is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's boolean is null. + */ + public KeywordsAssert hasNotNullBoolean() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting boolean of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Boolean actualBoolean = actual.getBoolean(); + if (actualBoolean == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Keywords's break contains the given Object elements. * @param expectedBreak the given elements that should be contained in actual Keywords's break. @@ -252,6 +386,49 @@ public class KeywordsAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's break is not null. + */ + public KeywordsAssert hasNullBreak() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting break of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualBreak = actual.getBreak(); + if (actualBreak != null) { + failWithMessage(assertjErrorMessage, actual, actualBreak); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's break is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's break is null. + */ + public KeywordsAssert hasNotNullBreak() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting break of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualBreak = actual.getBreak(); + if (actualBreak == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } /** * Verifies that the actual Keywords's byte is equal to the given one. @@ -276,6 +453,50 @@ public class KeywordsAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's byte is not null. + */ + public KeywordsAssert hasNullByte() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting byte of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Byte actualByte = actual.getByte(); + if (actualByte != null) { + failWithMessage(assertjErrorMessage, actual, actualByte); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's byte is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's byte is null. + */ + public KeywordsAssert hasNotNullByte() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting byte of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Byte actualByte = actual.getByte(); + if (actualByte == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Keywords's case contains the given Object elements. * @param expectedCase the given elements that should be contained in actual Keywords's case. @@ -359,6 +580,49 @@ public class KeywordsAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's case is not null. + */ + public KeywordsAssert hasNullCase() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting case of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object[] actualCase = actual.getCase(); + if (actualCase != null) { + failWithMessage(assertjErrorMessage, actual, actualCase); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's case is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's case is null. + */ + public KeywordsAssert hasNotNullCase() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting case of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object[] actualCase = actual.getCase(); + if (actualCase == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } /** * Verifies that the actual Keywords's catch is equal to the given one. @@ -383,6 +647,50 @@ public class KeywordsAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's catch is not null. + */ + public KeywordsAssert hasNullCatch() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting catch of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualCatch = actual.getCatch(); + if (actualCatch != null) { + failWithMessage(assertjErrorMessage, actual, actualCatch); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's catch is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's catch is null. + */ + public KeywordsAssert hasNotNullCatch() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting catch of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualCatch = actual.getCatch(); + if (actualCatch == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Keywords's char is equal to the given one. * @param expectedChar the given char to compare the actual Keywords's char to. @@ -466,22 +774,21 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's continue is not equal to the given one. + * @throws AssertionError - if the actual Keywords's const is not null. */ - public KeywordsAssert hasContinue(String expectedContinue) { + public KeywordsAssert hasNullConst() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting continue of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting const of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // null safe check - String actualContinue = actual.getContinue(); - if (!Objects.areEqual(actualContinue, expectedContinue)) { - failWithMessage(assertjErrorMessage, actual, expectedContinue, actualContinue); + // check + Class actualConst = actual.getConst(); + if (actualConst != null) { + failWithMessage(assertjErrorMessage, actual, actualConst); } // return the current assertion for method chaining @@ -489,40 +796,129 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError if the actual Keywords's default does not contain all given String elements. - * @throws java.io.IOException if actual.getDefault() throws one. + * @throws AssertionError - if the actual Keywords's const is null. */ - public KeywordsAssert hasDefault(String... expectedDefault) throws java.io.IOException { + public KeywordsAssert hasNotNullConst() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); - // check that given String varargs is not null. - if (expectedDefault == null) failWithMessage("Expecting default parameter not to be null."); + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting const of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // check with standard error message, to set another message call: info.overridingErrorMessage("my error message"); - Iterables.instance().assertContains(info, actual.getDefault(), expectedDefault); + // check + Class actualConst = actual.getConst(); + if (actualConst == null) { + failWithMessage(assertjErrorMessage, actual); + } // return the current assertion for method chaining return this; } /** - * Verifies that the actual Keywords's default contains the given String elements in Collection. - * @param expectedDefault the given elements that should be contained in actual Keywords's default. + * Verifies that the actual Keywords's continue is equal to the given one. + * @param expectedContinue the given continue to compare the actual Keywords's continue to. * @return this assertion object. - * @throws AssertionError if the actual Keywords's default does not contain all given String elements. - * @throws java.io.IOException if actual.getDefault() throws one. + * @throws AssertionError - if the actual Keywords's continue is not equal to the given one. */ - public KeywordsAssert hasDefault(java.util.Collection expectedDefault) throws java.io.IOException { + public KeywordsAssert hasContinue(String expectedContinue) { // check that actual Keywords we want to make assertions on is not null. isNotNull(); - // check that given String collection is not null. - if (expectedDefault == null) { - failWithMessage("Expecting default parameter not to be null."); + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting continue of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + String actualContinue = actual.getContinue(); + if (!Objects.areEqual(actualContinue, expectedContinue)) { + failWithMessage(assertjErrorMessage, actual, expectedContinue, actualContinue); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's continue is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's continue is not null. + */ + public KeywordsAssert hasNullContinue() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting continue of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualContinue = actual.getContinue(); + if (actualContinue != null) { + failWithMessage(assertjErrorMessage, actual, actualContinue); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's continue is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's continue is null. + */ + public KeywordsAssert hasNotNullContinue() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting continue of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualContinue = actual.getContinue(); + if (actualContinue == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's default contains the given String elements. + * @param expectedDefault the given elements that should be contained in actual Keywords's default. + * @return this assertion object. + * @throws AssertionError if the actual Keywords's default does not contain all given String elements. + * @throws java.io.IOException if actual.getDefault() throws one. + */ + public KeywordsAssert hasDefault(String... expectedDefault) throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // check that given String varargs is not null. + if (expectedDefault == null) failWithMessage("Expecting default parameter not to be null."); + + // check with standard error message, to set another message call: info.overridingErrorMessage("my error message"); + Iterables.instance().assertContains(info, actual.getDefault(), expectedDefault); + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's default contains the given String elements in Collection. + * @param expectedDefault the given elements that should be contained in actual Keywords's default. + * @return this assertion object. + * @throws AssertionError if the actual Keywords's default does not contain all given String elements. + * @throws java.io.IOException if actual.getDefault() throws one. + */ + public KeywordsAssert hasDefault(java.util.Collection expectedDefault) throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // check that given String collection is not null. + if (expectedDefault == null) { + failWithMessage("Expecting default parameter not to be null."); return this; // to fool Eclipse "Null pointer access" warning on toArray. } @@ -647,6 +1043,51 @@ public class KeywordsAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's default is not null. + * @throws java.io.IOException if actual.getDefault() throws one. + */ + public KeywordsAssert hasNullDefault() throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting default of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualDefault = actual.getDefault(); + if (actualDefault != null) { + failWithMessage(assertjErrorMessage, actual, actualDefault); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's default is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's default is null. + * @throws java.io.IOException if actual.getDefault() throws one. + */ + public KeywordsAssert hasNotNullDefault() throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting default of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualDefault = actual.getDefault(); + if (actualDefault == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } /** * Verifies that the actual Keywords's do is equal to the given one. @@ -671,6 +1112,50 @@ public class KeywordsAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's do is not null. + */ + public KeywordsAssert hasNullDo() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting do of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualDo = actual.getDo(); + if (actualDo != null) { + failWithMessage(assertjErrorMessage, actual, actualDo); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's do is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's do is null. + */ + public KeywordsAssert hasNotNullDo() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting do of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualDo = actual.getDo(); + if (actualDo == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Keywords's double is equal to the given one. * @param expectedDouble the given double to compare the actual Keywords's double to. @@ -744,22 +1229,21 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's enum is not equal to the given one. + * @throws AssertionError - if the actual Keywords's else is not null. */ - public KeywordsAssert hasEnum(Object expectedEnum) { + public KeywordsAssert hasNullElse() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting enum of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting else of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // null safe check - Object actualEnum = actual.getEnum(); - if (!Objects.areEqual(actualEnum, expectedEnum)) { - failWithMessage(assertjErrorMessage, actual, expectedEnum, actualEnum); + // check + Object actualElse = actual.getElse(); + if (actualElse != null) { + failWithMessage(assertjErrorMessage, actual, actualElse); } // return the current assertion for method chaining @@ -767,22 +1251,21 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's extends is not equal to the given one. + * @throws AssertionError - if the actual Keywords's else is null. */ - public KeywordsAssert hasExtends(Object expectedExtends) { + public KeywordsAssert hasNotNullElse() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting extends of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting else of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // null safe check - Object actualExtends = actual.getExtends(); - if (!Objects.areEqual(actualExtends, expectedExtends)) { - failWithMessage(assertjErrorMessage, actual, expectedExtends, actualExtends); + // check + Object actualElse = actual.getElse(); + if (actualElse == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -790,22 +1273,22 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's final is not equal to the given one. + * @throws AssertionError - if the actual Keywords's enum is not null. */ - public KeywordsAssert hasFinal(Object expectedFinal) { + public KeywordsAssert hasNullEnum() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting final of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting enum of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // null safe check - Object actualFinal = actual.getFinal(); - if (!Objects.areEqual(actualFinal, expectedFinal)) { - failWithMessage(assertjErrorMessage, actual, expectedFinal, actualFinal); + // check + Object actualEnum = actual.getEnum(); + if (actualEnum != null) { + failWithMessage(assertjErrorMessage, actual, actualEnum); } // return the current assertion for method chaining @@ -836,22 +1318,21 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's finally is not equal to the given one. + * @throws AssertionError - if the actual Keywords's enum is null. */ - public KeywordsAssert hasFinally(Object expectedFinally) { + public KeywordsAssert hasNotNullEnum() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting finally of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting enum of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // null safe check - Object actualFinally = actual.getFinally(); - if (!Objects.areEqual(actualFinally, expectedFinally)) { - failWithMessage(assertjErrorMessage, actual, expectedFinally, actualFinally); + // check + Object actualEnum = actual.getEnum(); + if (actualEnum == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -859,22 +1340,22 @@ public class KeywordsAssert extends AbstractObjectAssert - * If difference is equal to the offset value, assertion is considered successful. - * @param expectedFloat the value to compare the actual Keywords's float to. - * @param assertjOffset the given offset. + * Verifies that the actual Keywords's extends is null. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's float is not close enough to the given value. + * @throws AssertionError - if the actual Keywords's extends is not null. */ - public KeywordsAssert hasFloatCloseTo(float expectedFloat, float assertjOffset) { + public KeywordsAssert hasNullExtends() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); - float actualFloat = actual.getFloat(); - // overrides the default error message with a more explicit one - String assertjErrorMessage = String.format("\nExpecting float:\n <%s>\nto be close to:\n <%s>\nby less than <%s> but difference was <%s>", - actualFloat, expectedFloat, assertjOffset, Math.abs(expectedFloat - actualFloat)); + String assertjErrorMessage = "\nExpecting extends of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; // check - Assertions.assertThat(actualFloat).overridingErrorMessage(assertjErrorMessage).isCloseTo(expectedFloat, Assertions.within(assertjOffset)); + Object actualExtends = actual.getExtends(); + if (actualExtends != null) { + failWithMessage(assertjErrorMessage, actual, actualExtends); + } // return the current assertion for method chaining return this; } /** - * Verifies that the actual Keywords's for is equal to the given one. - * @param expectedFor the given for to compare the actual Keywords's for to. + * Verifies that the actual Keywords's extends is not null. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's for is not equal to the given one. - * @throws java.io.IOException if actual.getFor() throws one. + * @throws AssertionError - if the actual Keywords's extends is null. */ - public KeywordsAssert hasFor(Object expectedFor) throws java.io.IOException { + public KeywordsAssert hasNotNullExtends() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting for of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting extends of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // null safe check - Object actualFor = actual.getFor(); - if (!Objects.areEqual(actualFor, expectedFor)) { - failWithMessage(assertjErrorMessage, actual, expectedFor, actualFor); + // check + Object actualExtends = actual.getExtends(); + if (actualExtends == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -932,22 +1407,22 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's if is not equal to the given one. + * @throws AssertionError - if the actual Keywords's false is not null. */ - public KeywordsAssert hasIf(Object expectedIf) { + public KeywordsAssert hasNullFalse() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting if of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting false of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // null safe check - Object actualIf = actual.getIf(); - if (!Objects.areEqual(actualIf, expectedIf)) { - failWithMessage(assertjErrorMessage, actual, expectedIf, actualIf); + // check + Object actualFalse = actual.getFalse(); + if (actualFalse != null) { + failWithMessage(assertjErrorMessage, actual, actualFalse); } // return the current assertion for method chaining @@ -978,22 +1452,21 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's implements is not equal to the given one. + * @throws AssertionError - if the actual Keywords's false is null. */ - public KeywordsAssert hasImplements(Object expectedImplements) { + public KeywordsAssert hasNotNullFalse() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting implements of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting false of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // null safe check - Object actualImplements = actual.getImplements(); - if (!Objects.areEqual(actualImplements, expectedImplements)) { - failWithMessage(assertjErrorMessage, actual, expectedImplements, actualImplements); + // check + Object actualFalse = actual.getFalse(); + if (actualFalse == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -1001,22 +1474,22 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's instanceof is not equal to the given one. + * @throws AssertionError - if the actual Keywords's final is not null. */ - public KeywordsAssert hasInstanceof(Object expectedInstanceof) { + public KeywordsAssert hasNullFinal() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting instanceof of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting final of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // null safe check - Object actualInstanceof = actual.getInstanceof(); - if (!Objects.areEqual(actualInstanceof, expectedInstanceof)) { - failWithMessage(assertjErrorMessage, actual, expectedInstanceof, actualInstanceof); + // check + Object actualFinal = actual.getFinal(); + if (actualFinal != null) { + failWithMessage(assertjErrorMessage, actual, actualFinal); } // return the current assertion for method chaining @@ -1047,23 +1519,21 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's int is not equal to the given one. - * @throws java.io.IOException if actual.getInt() throws one. + * @throws AssertionError - if the actual Keywords's final is null. */ - public KeywordsAssert hasInt(int expectedInt) throws java.io.IOException { + public KeywordsAssert hasNotNullFinal() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting int of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting final of:\n <%s>\nto be:\n not-null\nbut was:\n "; // check - int actualInt = actual.getInt(); - if (actualInt != expectedInt) { - failWithMessage(assertjErrorMessage, actual, expectedInt, actualInt); + Object actualFinal = actual.getFinal(); + if (actualFinal == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -1071,22 +1541,22 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's long is not equal to the given one. + * @throws AssertionError - if the actual Keywords's finally is not null. */ - public KeywordsAssert hasLong(long expectedLong) { + public KeywordsAssert hasNullFinally() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting long of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting finally of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; // check - long actualLong = actual.getLong(); - if (actualLong != expectedLong) { - failWithMessage(assertjErrorMessage, actual, expectedLong, actualLong); + Object actualFinally = actual.getFinally(); + if (actualFinally != null) { + failWithMessage(assertjErrorMessage, actual, actualFinally); } // return the current assertion for method chaining @@ -1117,22 +1586,21 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's native is not equal to the given one. + * @throws AssertionError - if the actual Keywords's finally is null. */ - public KeywordsAssert hasNative(Object expectedNative) { + public KeywordsAssert hasNotNullFinally() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting native of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting finally of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // null safe check - Object actualNative = actual.getNative(); - if (!Objects.areEqual(actualNative, expectedNative)) { - failWithMessage(assertjErrorMessage, actual, expectedNative, actualNative); + // check + Object actualFinally = actual.getFinally(); + if (actualFinally == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -1140,22 +1608,22 @@ public class KeywordsAssert extends AbstractObjectAssert + * If difference is equal to the offset value, assertion is considered successful. + * @param expectedFloat the value to compare the actual Keywords's float to. + * @param assertjOffset the given offset. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's null is not equal to the given one. + * @throws AssertionError - if the actual Keywords's float is not close enough to the given value. */ - public KeywordsAssert hasNull(Object expectedNull) { + public KeywordsAssert hasFloatCloseTo(float expectedFloat, float assertjOffset) { // check that actual Keywords we want to make assertions on is not null. isNotNull(); + float actualFloat = actual.getFloat(); + // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting null of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = String.format("\nExpecting float:\n <%s>\nto be close to:\n <%s>\nby less than <%s> but difference was <%s>", + actualFloat, expectedFloat, assertjOffset, Math.abs(expectedFloat - actualFloat)); - // null safe check - Object actualNull = actual.getNull(); - if (!Objects.areEqual(actualNull, expectedNull)) { - failWithMessage(assertjErrorMessage, actual, expectedNull, actualNull); - } + // check + Assertions.assertThat(actualFloat).overridingErrorMessage(assertjErrorMessage).isCloseTo(expectedFloat, Assertions.within(assertjOffset)); // return the current assertion for method chaining return this; } /** - * Verifies that the actual Keywords's package is equal to the given one. - * @param expectedPackage the given package to compare the actual Keywords's package to. + * Verifies that the actual Keywords's for is equal to the given one. + * @param expectedFor the given for to compare the actual Keywords's for to. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's package is not equal to the given one. + * @throws AssertionError - if the actual Keywords's for is not equal to the given one. + * @throws java.io.IOException if actual.getFor() throws one. */ - public KeywordsAssert hasPackage(Object expectedPackage) { + public KeywordsAssert hasFor(Object expectedFor) throws java.io.IOException { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting package of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting for of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; // null safe check - Object actualPackage = actual.getPackage(); - if (!Objects.areEqual(actualPackage, expectedPackage)) { - failWithMessage(assertjErrorMessage, actual, expectedPackage, actualPackage); + Object actualFor = actual.getFor(); + if (!Objects.areEqual(actualFor, expectedFor)) { + failWithMessage(assertjErrorMessage, actual, expectedFor, actualFor); } // return the current assertion for method chaining @@ -1209,22 +1681,22 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's private is not equal to the given one. + * @throws AssertionError - if the actual Keywords's for is not null. + * @throws java.io.IOException if actual.getFor() throws one. */ - public KeywordsAssert hasPrivate(Object expectedPrivate) { + public KeywordsAssert hasNullFor() throws java.io.IOException { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting private of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting for of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // null safe check - Object actualPrivate = actual.getPrivate(); - if (!Objects.areEqual(actualPrivate, expectedPrivate)) { - failWithMessage(assertjErrorMessage, actual, expectedPrivate, actualPrivate); + // check + Object actualFor = actual.getFor(); + if (actualFor != null) { + failWithMessage(assertjErrorMessage, actual, actualFor); } // return the current assertion for method chaining @@ -1232,22 +1704,22 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's protected is not equal to the given one. + * @throws AssertionError - if the actual Keywords's for is null. + * @throws java.io.IOException if actual.getFor() throws one. */ - public KeywordsAssert hasProtected(Object expectedProtected) { + public KeywordsAssert hasNotNullFor() throws java.io.IOException { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting protected of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting for of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // null safe check - Object actualProtected = actual.getProtected(); - if (!Objects.areEqual(actualProtected, expectedProtected)) { - failWithMessage(assertjErrorMessage, actual, expectedProtected, actualProtected); + // check + Object actualFor = actual.getFor(); + if (actualFor == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -1255,22 +1727,22 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's return is not equal to the given one. + * @throws AssertionError - if the actual Keywords's goto is not null. */ - public KeywordsAssert hasReturn(Object expectedReturn) { + public KeywordsAssert hasNullGoto() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting return of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting goto of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // null safe check - Object actualReturn = actual.getReturn(); - if (!Objects.areEqual(actualReturn, expectedReturn)) { - failWithMessage(assertjErrorMessage, actual, expectedReturn, actualReturn); + // check + Object actualGoto = actual.getGoto(); + if (actualGoto != null) { + failWithMessage(assertjErrorMessage, actual, actualGoto); } // return the current assertion for method chaining @@ -1301,22 +1772,21 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's short is not equal to the given one. + * @throws AssertionError - if the actual Keywords's goto is null. */ - public KeywordsAssert hasShort(short expectedShort) { + public KeywordsAssert hasNotNullGoto() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting short of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting goto of:\n <%s>\nto be:\n not-null\nbut was:\n "; // check - short actualShort = actual.getShort(); - if (actualShort != expectedShort) { - failWithMessage(assertjErrorMessage, actual, expectedShort, actualShort); + Object actualGoto = actual.getGoto(); + if (actualGoto == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -1324,22 +1794,22 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's strictfp is not equal to the given one. + * @throws AssertionError - if the actual Keywords's if is not null. */ - public KeywordsAssert hasStrictfp(Object expectedStrictfp) { + public KeywordsAssert hasNullIf() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting strictfp of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting if of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // null safe check - Object actualStrictfp = actual.getStrictfp(); - if (!Objects.areEqual(actualStrictfp, expectedStrictfp)) { - failWithMessage(assertjErrorMessage, actual, expectedStrictfp, actualStrictfp); + // check + Object actualIf = actual.getIf(); + if (actualIf != null) { + failWithMessage(assertjErrorMessage, actual, actualIf); } // return the current assertion for method chaining @@ -1370,22 +1839,1453 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's super is not equal to the given one. + * @throws AssertionError - if the actual Keywords's if is null. */ - public KeywordsAssert hasSuper(Object expectedSuper) { + public KeywordsAssert hasNotNullIf() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting super of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting if of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // null safe check - Object actualSuper = actual.getSuper(); - if (!Objects.areEqual(actualSuper, expectedSuper)) { - failWithMessage(assertjErrorMessage, actual, expectedSuper, actualSuper); + // check + Object actualIf = actual.getIf(); + if (actualIf == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's implements is equal to the given one. + * @param expectedImplements the given implements to compare the actual Keywords's implements to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's implements is not equal to the given one. + */ + public KeywordsAssert hasImplements(Object expectedImplements) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting implements of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualImplements = actual.getImplements(); + if (!Objects.areEqual(actualImplements, expectedImplements)) { + failWithMessage(assertjErrorMessage, actual, expectedImplements, actualImplements); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's implements is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's implements is not null. + */ + public KeywordsAssert hasNullImplements() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting implements of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualImplements = actual.getImplements(); + if (actualImplements != null) { + failWithMessage(assertjErrorMessage, actual, actualImplements); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's implements is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's implements is null. + */ + public KeywordsAssert hasNotNullImplements() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting implements of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualImplements = actual.getImplements(); + if (actualImplements == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's import is equal to the given one. + * @param expectedImport the given import to compare the actual Keywords's import to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's import is not equal to the given one. + */ + public KeywordsAssert hasImport(Object expectedImport) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting import of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualImport = actual.getImport(); + if (!Objects.areEqual(actualImport, expectedImport)) { + failWithMessage(assertjErrorMessage, actual, expectedImport, actualImport); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's import is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's import is not null. + */ + public KeywordsAssert hasNullImport() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting import of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualImport = actual.getImport(); + if (actualImport != null) { + failWithMessage(assertjErrorMessage, actual, actualImport); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's import is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's import is null. + */ + public KeywordsAssert hasNotNullImport() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting import of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualImport = actual.getImport(); + if (actualImport == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's instanceof is equal to the given one. + * @param expectedInstanceof the given instanceof to compare the actual Keywords's instanceof to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's instanceof is not equal to the given one. + */ + public KeywordsAssert hasInstanceof(Object expectedInstanceof) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting instanceof of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualInstanceof = actual.getInstanceof(); + if (!Objects.areEqual(actualInstanceof, expectedInstanceof)) { + failWithMessage(assertjErrorMessage, actual, expectedInstanceof, actualInstanceof); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's instanceof is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's instanceof is not null. + */ + public KeywordsAssert hasNullInstanceof() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting instanceof of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualInstanceof = actual.getInstanceof(); + if (actualInstanceof != null) { + failWithMessage(assertjErrorMessage, actual, actualInstanceof); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's instanceof is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's instanceof is null. + */ + public KeywordsAssert hasNotNullInstanceof() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting instanceof of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualInstanceof = actual.getInstanceof(); + if (actualInstanceof == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's int is equal to the given one. + * @param expectedInt the given int to compare the actual Keywords's int to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's int is not equal to the given one. + * @throws java.io.IOException if actual.getInt() throws one. + */ + public KeywordsAssert hasInt(int expectedInt) throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting int of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // check + int actualInt = actual.getInt(); + if (actualInt != expectedInt) { + failWithMessage(assertjErrorMessage, actual, expectedInt, actualInt); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's interface is equal to the given one. + * @param expectedInterface the given interface to compare the actual Keywords's interface to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's interface is not equal to the given one. + */ + public KeywordsAssert hasInterface(Object expectedInterface) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting interface of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualInterface = actual.getInterface(); + if (!Objects.areEqual(actualInterface, expectedInterface)) { + failWithMessage(assertjErrorMessage, actual, expectedInterface, actualInterface); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's interface is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's interface is not null. + */ + public KeywordsAssert hasNullInterface() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting interface of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualInterface = actual.getInterface(); + if (actualInterface != null) { + failWithMessage(assertjErrorMessage, actual, actualInterface); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's interface is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's interface is null. + */ + public KeywordsAssert hasNotNullInterface() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting interface of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualInterface = actual.getInterface(); + if (actualInterface == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's long is equal to the given one. + * @param expectedLong the given long to compare the actual Keywords's long to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's long is not equal to the given one. + */ + public KeywordsAssert hasLong(long expectedLong) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting long of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // check + long actualLong = actual.getLong(); + if (actualLong != expectedLong) { + failWithMessage(assertjErrorMessage, actual, expectedLong, actualLong); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's native is equal to the given one. + * @param expectedNative the given native to compare the actual Keywords's native to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's native is not equal to the given one. + */ + public KeywordsAssert hasNative(Object expectedNative) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting native of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualNative = actual.getNative(); + if (!Objects.areEqual(actualNative, expectedNative)) { + failWithMessage(assertjErrorMessage, actual, expectedNative, actualNative); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's native is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's native is not null. + */ + public KeywordsAssert hasNullNative() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting native of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualNative = actual.getNative(); + if (actualNative != null) { + failWithMessage(assertjErrorMessage, actual, actualNative); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's native is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's native is null. + */ + public KeywordsAssert hasNotNullNative() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting native of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualNative = actual.getNative(); + if (actualNative == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's new is equal to the given one. + * @param expectedNew the given new to compare the actual Keywords's new to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's new is not equal to the given one. + */ + public KeywordsAssert hasNew(Object expectedNew) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting new of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualNew = actual.getNew(); + if (!Objects.areEqual(actualNew, expectedNew)) { + failWithMessage(assertjErrorMessage, actual, expectedNew, actualNew); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's new is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's new is not null. + */ + public KeywordsAssert hasNullNew() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting new of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualNew = actual.getNew(); + if (actualNew != null) { + failWithMessage(assertjErrorMessage, actual, actualNew); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's new is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's new is null. + */ + public KeywordsAssert hasNotNullNew() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting new of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualNew = actual.getNew(); + if (actualNew == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's null is equal to the given one. + * @param expectedNull the given null to compare the actual Keywords's null to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's null is not equal to the given one. + */ + public KeywordsAssert hasNull(Object expectedNull) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting null of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualNull = actual.getNull(); + if (!Objects.areEqual(actualNull, expectedNull)) { + failWithMessage(assertjErrorMessage, actual, expectedNull, actualNull); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's null is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's null is not null. + */ + public KeywordsAssert hasNullNull() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting null of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualNull = actual.getNull(); + if (actualNull != null) { + failWithMessage(assertjErrorMessage, actual, actualNull); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's null is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's null is null. + */ + public KeywordsAssert hasNotNullNull() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting null of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualNull = actual.getNull(); + if (actualNull == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's package is equal to the given one. + * @param expectedPackage the given package to compare the actual Keywords's package to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's package is not equal to the given one. + */ + public KeywordsAssert hasPackage(Object expectedPackage) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting package of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualPackage = actual.getPackage(); + if (!Objects.areEqual(actualPackage, expectedPackage)) { + failWithMessage(assertjErrorMessage, actual, expectedPackage, actualPackage); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's package is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's package is not null. + */ + public KeywordsAssert hasNullPackage() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting package of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualPackage = actual.getPackage(); + if (actualPackage != null) { + failWithMessage(assertjErrorMessage, actual, actualPackage); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's package is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's package is null. + */ + public KeywordsAssert hasNotNullPackage() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting package of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualPackage = actual.getPackage(); + if (actualPackage == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's private is equal to the given one. + * @param expectedPrivate the given private to compare the actual Keywords's private to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's private is not equal to the given one. + */ + public KeywordsAssert hasPrivate(Object expectedPrivate) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting private of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualPrivate = actual.getPrivate(); + if (!Objects.areEqual(actualPrivate, expectedPrivate)) { + failWithMessage(assertjErrorMessage, actual, expectedPrivate, actualPrivate); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's private is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's private is not null. + */ + public KeywordsAssert hasNullPrivate() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting private of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualPrivate = actual.getPrivate(); + if (actualPrivate != null) { + failWithMessage(assertjErrorMessage, actual, actualPrivate); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's private is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's private is null. + */ + public KeywordsAssert hasNotNullPrivate() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting private of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualPrivate = actual.getPrivate(); + if (actualPrivate == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's protected is equal to the given one. + * @param expectedProtected the given protected to compare the actual Keywords's protected to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's protected is not equal to the given one. + */ + public KeywordsAssert hasProtected(Object expectedProtected) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting protected of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualProtected = actual.getProtected(); + if (!Objects.areEqual(actualProtected, expectedProtected)) { + failWithMessage(assertjErrorMessage, actual, expectedProtected, actualProtected); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's protected is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's protected is not null. + */ + public KeywordsAssert hasNullProtected() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting protected of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualProtected = actual.getProtected(); + if (actualProtected != null) { + failWithMessage(assertjErrorMessage, actual, actualProtected); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's protected is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's protected is null. + */ + public KeywordsAssert hasNotNullProtected() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting protected of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualProtected = actual.getProtected(); + if (actualProtected == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's public is equal to the given one. + * @param expectedPublic the given public to compare the actual Keywords's public to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's public is not equal to the given one. + */ + public KeywordsAssert hasPublic(Object expectedPublic) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting public of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualPublic = actual.getPublic(); + if (!Objects.areEqual(actualPublic, expectedPublic)) { + failWithMessage(assertjErrorMessage, actual, expectedPublic, actualPublic); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's public is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's public is not null. + */ + public KeywordsAssert hasNullPublic() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting public of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualPublic = actual.getPublic(); + if (actualPublic != null) { + failWithMessage(assertjErrorMessage, actual, actualPublic); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's public is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's public is null. + */ + public KeywordsAssert hasNotNullPublic() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting public of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualPublic = actual.getPublic(); + if (actualPublic == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's return is equal to the given one. + * @param expectedReturn the given return to compare the actual Keywords's return to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's return is not equal to the given one. + */ + public KeywordsAssert hasReturn(Object expectedReturn) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting return of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualReturn = actual.getReturn(); + if (!Objects.areEqual(actualReturn, expectedReturn)) { + failWithMessage(assertjErrorMessage, actual, expectedReturn, actualReturn); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's return is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's return is not null. + */ + public KeywordsAssert hasNullReturn() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting return of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualReturn = actual.getReturn(); + if (actualReturn != null) { + failWithMessage(assertjErrorMessage, actual, actualReturn); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's return is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's return is null. + */ + public KeywordsAssert hasNotNullReturn() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting return of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualReturn = actual.getReturn(); + if (actualReturn == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's short is equal to the given one. + * @param expectedShort the given short to compare the actual Keywords's short to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's short is not equal to the given one. + */ + public KeywordsAssert hasShort(short expectedShort) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting short of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // check + short actualShort = actual.getShort(); + if (actualShort != expectedShort) { + failWithMessage(assertjErrorMessage, actual, expectedShort, actualShort); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's static is equal to the given one. + * @param expectedStatic the given static to compare the actual Keywords's static to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's static is not equal to the given one. + */ + public KeywordsAssert hasStatic(Object expectedStatic) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting static of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualStatic = actual.getStatic(); + if (!Objects.areEqual(actualStatic, expectedStatic)) { + failWithMessage(assertjErrorMessage, actual, expectedStatic, actualStatic); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's static is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's static is not null. + */ + public KeywordsAssert hasNullStatic() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting static of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualStatic = actual.getStatic(); + if (actualStatic != null) { + failWithMessage(assertjErrorMessage, actual, actualStatic); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's static is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's static is null. + */ + public KeywordsAssert hasNotNullStatic() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting static of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualStatic = actual.getStatic(); + if (actualStatic == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's strictfp is equal to the given one. + * @param expectedStrictfp the given strictfp to compare the actual Keywords's strictfp to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's strictfp is not equal to the given one. + */ + public KeywordsAssert hasStrictfp(Object expectedStrictfp) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting strictfp of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualStrictfp = actual.getStrictfp(); + if (!Objects.areEqual(actualStrictfp, expectedStrictfp)) { + failWithMessage(assertjErrorMessage, actual, expectedStrictfp, actualStrictfp); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's strictfp is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's strictfp is not null. + */ + public KeywordsAssert hasNullStrictfp() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting strictfp of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualStrictfp = actual.getStrictfp(); + if (actualStrictfp != null) { + failWithMessage(assertjErrorMessage, actual, actualStrictfp); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's strictfp is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's strictfp is null. + */ + public KeywordsAssert hasNotNullStrictfp() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting strictfp of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualStrictfp = actual.getStrictfp(); + if (actualStrictfp == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's super is equal to the given one. + * @param expectedSuper the given super to compare the actual Keywords's super to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's super is not equal to the given one. + */ + public KeywordsAssert hasSuper(Object expectedSuper) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting super of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualSuper = actual.getSuper(); + if (!Objects.areEqual(actualSuper, expectedSuper)) { + failWithMessage(assertjErrorMessage, actual, expectedSuper, actualSuper); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's super is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's super is not null. + */ + public KeywordsAssert hasNullSuper() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting super of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualSuper = actual.getSuper(); + if (actualSuper != null) { + failWithMessage(assertjErrorMessage, actual, actualSuper); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's super is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's super is null. + */ + public KeywordsAssert hasNotNullSuper() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting super of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualSuper = actual.getSuper(); + if (actualSuper == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's switch contains the given String elements. + * @param expectedSwitch the given elements that should be contained in actual Keywords's switch. + * @return this assertion object. + * @throws AssertionError if the actual Keywords's switch does not contain all given String elements. + * @throws java.io.IOException if actual.getSwitch() throws one. + */ + public KeywordsAssert hasSwitch(String... expectedSwitch) throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // check that given String varargs is not null. + if (expectedSwitch == null) failWithMessage("Expecting switch parameter not to be null."); + + // check with standard error message (use overridingErrorMessage before contains to set your own message). + Assertions.assertThat(actual.getSwitch()).contains(expectedSwitch); + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's switch contains only the given String elements and nothing else in whatever order. + * + * @param expectedSwitch the given elements that should be contained in actual Keywords's switch. + * @return this assertion object. + * @throws AssertionError if the actual Keywords's switch does not contain all given String elements and nothing else. + * @throws java.io.IOException if actual.getSwitch() throws one. + */ + public KeywordsAssert hasOnlySwitch(String... expectedSwitch) throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // check that given String varargs is not null. + if (expectedSwitch == null) failWithMessage("Expecting switch parameter not to be null."); + + // check with standard error message (use overridingErrorMessage before contains to set your own message). + Assertions.assertThat(actual.getSwitch()).containsOnly(expectedSwitch); + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's switch does not contain the given String elements. + * + * @param expectedSwitch the given elements that should not be in actual Keywords's switch. + * @return this assertion object. + * @throws AssertionError if the actual Keywords's switch contains any given String elements. + * @throws java.io.IOException if actual.getSwitch() throws one. + */ + public KeywordsAssert doesNotHaveSwitch(String... expectedSwitch) throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // check that given String varargs is not null. + if (expectedSwitch == null) failWithMessage("Expecting switch parameter not to be null."); + + // check with standard error message (use overridingErrorMessage before contains to set your own message). + Assertions.assertThat(actual.getSwitch()).doesNotContain(expectedSwitch); + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords has no switch. + * @return this assertion object. + * @throws AssertionError if the actual Keywords's switch is not empty. + * @throws java.io.IOException if actual.getSwitch() throws one. + */ + public KeywordsAssert hasNoSwitch() throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // we override the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting :\n <%s>\nnot to have switch but had :\n <%s>"; + + // check that it is not empty + if (actual.getSwitch().length > 0) { + failWithMessage(assertjErrorMessage, actual, java.util.Arrays.toString(actual.getSwitch())); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's switch is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's switch is not null. + * @throws java.io.IOException if actual.getSwitch() throws one. + */ + public KeywordsAssert hasNullSwitch() throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting switch of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String[] actualSwitch = actual.getSwitch(); + if (actualSwitch != null) { + failWithMessage(assertjErrorMessage, actual, actualSwitch); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's switch is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's switch is null. + * @throws java.io.IOException if actual.getSwitch() throws one. + */ + public KeywordsAssert hasNotNullSwitch() throws java.io.IOException { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting switch of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String[] actualSwitch = actual.getSwitch(); + if (actualSwitch == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's synchronized is equal to the given one. + * @param expectedSynchronized the given synchronized to compare the actual Keywords's synchronized to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's synchronized is not equal to the given one. + */ + public KeywordsAssert hasSynchronized(Object expectedSynchronized) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting synchronized of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualSynchronized = actual.getSynchronized(); + if (!Objects.areEqual(actualSynchronized, expectedSynchronized)) { + failWithMessage(assertjErrorMessage, actual, expectedSynchronized, actualSynchronized); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's synchronized is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's synchronized is not null. + */ + public KeywordsAssert hasNullSynchronized() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting synchronized of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualSynchronized = actual.getSynchronized(); + if (actualSynchronized != null) { + failWithMessage(assertjErrorMessage, actual, actualSynchronized); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's synchronized is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's synchronized is null. + */ + public KeywordsAssert hasNotNullSynchronized() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting synchronized of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualSynchronized = actual.getSynchronized(); + if (actualSynchronized == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's this is equal to the given one. + * @param expectedThis the given this to compare the actual Keywords's this to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's this is not equal to the given one. + */ + public KeywordsAssert hasThis(Object expectedThis) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting this of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualThis = actual.getThis(); + if (!Objects.areEqual(actualThis, expectedThis)) { + failWithMessage(assertjErrorMessage, actual, expectedThis, actualThis); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's this is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's this is not null. + */ + public KeywordsAssert hasNullThis() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting this of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualThis = actual.getThis(); + if (actualThis != null) { + failWithMessage(assertjErrorMessage, actual, actualThis); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's this is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's this is null. + */ + public KeywordsAssert hasNotNullThis() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting this of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualThis = actual.getThis(); + if (actualThis == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's throw is equal to the given one. + * @param expectedThrow the given throw to compare the actual Keywords's throw to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's throw is not equal to the given one. + */ + public KeywordsAssert hasThrow(Object expectedThrow) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting throw of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualThrow = actual.getThrow(); + if (!Objects.areEqual(actualThrow, expectedThrow)) { + failWithMessage(assertjErrorMessage, actual, expectedThrow, actualThrow); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's throw is null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's throw is not null. + */ + public KeywordsAssert hasNullThrow() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting throw of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualThrow = actual.getThrow(); + if (actualThrow != null) { + failWithMessage(assertjErrorMessage, actual, actualThrow); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's throw is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's throw is null. + */ + public KeywordsAssert hasNotNullThrow() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting throw of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualThrow = actual.getThrow(); + if (actualThrow == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's throws is equal to the given one. + * @param expectedThrows the given throws to compare the actual Keywords's throws to. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's throws is not equal to the given one. + */ + public KeywordsAssert hasThrows(Object expectedThrows) { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting throws of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + + // null safe check + Object actualThrows = actual.getThrows(); + if (!Objects.areEqual(actualThrows, expectedThrows)) { + failWithMessage(assertjErrorMessage, actual, expectedThrows, actualThrows); } // return the current assertion for method chaining @@ -1393,110 +3293,110 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError if the actual Keywords's switch does not contain all given String elements. - * @throws java.io.IOException if actual.getSwitch() throws one. + * @throws AssertionError - if the actual Keywords's throws is not null. */ - public KeywordsAssert hasSwitch(String... expectedSwitch) throws java.io.IOException { + public KeywordsAssert hasNullThrows() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); - // check that given String varargs is not null. - if (expectedSwitch == null) failWithMessage("Expecting switch parameter not to be null."); + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting throws of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // check with standard error message (use overridingErrorMessage before contains to set your own message). - Assertions.assertThat(actual.getSwitch()).contains(expectedSwitch); + // check + Object actualThrows = actual.getThrows(); + if (actualThrows != null) { + failWithMessage(assertjErrorMessage, actual, actualThrows); + } // return the current assertion for method chaining return this; } /** - * Verifies that the actual Keywords's switch contains only the given String elements and nothing else in whatever order. - * - * @param expectedSwitch the given elements that should be contained in actual Keywords's switch. + * Verifies that the actual Keywords's throws is not null. * @return this assertion object. - * @throws AssertionError if the actual Keywords's switch does not contain all given String elements and nothing else. - * @throws java.io.IOException if actual.getSwitch() throws one. + * @throws AssertionError - if the actual Keywords's throws is null. */ - public KeywordsAssert hasOnlySwitch(String... expectedSwitch) throws java.io.IOException { + public KeywordsAssert hasNotNullThrows() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); - // check that given String varargs is not null. - if (expectedSwitch == null) failWithMessage("Expecting switch parameter not to be null."); + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting throws of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // check with standard error message (use overridingErrorMessage before contains to set your own message). - Assertions.assertThat(actual.getSwitch()).containsOnly(expectedSwitch); + // check + Object actualThrows = actual.getThrows(); + if (actualThrows == null) { + failWithMessage(assertjErrorMessage, actual); + } // return the current assertion for method chaining return this; } /** - * Verifies that the actual Keywords's switch does not contain the given String elements. - * - * @param expectedSwitch the given elements that should not be in actual Keywords's switch. + * Verifies that the actual Keywords's transient is equal to the given one. + * @param expectedTransient the given transient to compare the actual Keywords's transient to. * @return this assertion object. - * @throws AssertionError if the actual Keywords's switch contains any given String elements. - * @throws java.io.IOException if actual.getSwitch() throws one. + * @throws AssertionError - if the actual Keywords's transient is not equal to the given one. */ - public KeywordsAssert doesNotHaveSwitch(String... expectedSwitch) throws java.io.IOException { + public KeywordsAssert hasTransient(Object expectedTransient) { // check that actual Keywords we want to make assertions on is not null. isNotNull(); - // check that given String varargs is not null. - if (expectedSwitch == null) failWithMessage("Expecting switch parameter not to be null."); + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting transient of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; - // check with standard error message (use overridingErrorMessage before contains to set your own message). - Assertions.assertThat(actual.getSwitch()).doesNotContain(expectedSwitch); + // null safe check + Object actualTransient = actual.getTransient(); + if (!Objects.areEqual(actualTransient, expectedTransient)) { + failWithMessage(assertjErrorMessage, actual, expectedTransient, actualTransient); + } // return the current assertion for method chaining return this; } /** - * Verifies that the actual Keywords has no switch. + * Verifies that the actual Keywords's transient is null. * @return this assertion object. - * @throws AssertionError if the actual Keywords's switch is not empty. - * @throws java.io.IOException if actual.getSwitch() throws one. + * @throws AssertionError - if the actual Keywords's transient is not null. */ - public KeywordsAssert hasNoSwitch() throws java.io.IOException { + public KeywordsAssert hasNullTransient() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); - // we override the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting :\n <%s>\nnot to have switch but had :\n <%s>"; + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting transient of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // check that it is not empty - if (actual.getSwitch().length > 0) { - failWithMessage(assertjErrorMessage, actual, java.util.Arrays.toString(actual.getSwitch())); + // check + Object actualTransient = actual.getTransient(); + if (actualTransient != null) { + failWithMessage(assertjErrorMessage, actual, actualTransient); } // return the current assertion for method chaining return this; } - /** - * Verifies that the actual Keywords's synchronized is equal to the given one. - * @param expectedSynchronized the given synchronized to compare the actual Keywords's synchronized to. + * Verifies that the actual Keywords's transient is not null. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's synchronized is not equal to the given one. + * @throws AssertionError - if the actual Keywords's transient is null. */ - public KeywordsAssert hasSynchronized(Object expectedSynchronized) { + public KeywordsAssert hasNotNullTransient() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting synchronized of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting transient of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // null safe check - Object actualSynchronized = actual.getSynchronized(); - if (!Objects.areEqual(actualSynchronized, expectedSynchronized)) { - failWithMessage(assertjErrorMessage, actual, expectedSynchronized, actualSynchronized); + // check + Object actualTransient = actual.getTransient(); + if (actualTransient == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -1504,22 +3404,22 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's throw is not equal to the given one. + * @throws AssertionError - if the actual Keywords's true is not null. */ - public KeywordsAssert hasThrow(Object expectedThrow) { + public KeywordsAssert hasNullTrue() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting throw of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting true of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // null safe check - Object actualThrow = actual.getThrow(); - if (!Objects.areEqual(actualThrow, expectedThrow)) { - failWithMessage(assertjErrorMessage, actual, expectedThrow, actualThrow); + // check + Object actualTrue = actual.getTrue(); + if (actualTrue != null) { + failWithMessage(assertjErrorMessage, actual, actualTrue); } // return the current assertion for method chaining @@ -1550,22 +3449,21 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's throws is not equal to the given one. + * @throws AssertionError - if the actual Keywords's true is null. */ - public KeywordsAssert hasThrows(Object expectedThrows) { + public KeywordsAssert hasNotNullTrue() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting throws of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting true of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // null safe check - Object actualThrows = actual.getThrows(); - if (!Objects.areEqual(actualThrows, expectedThrows)) { - failWithMessage(assertjErrorMessage, actual, expectedThrows, actualThrows); + // check + Object actualTrue = actual.getTrue(); + if (actualTrue == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -1573,22 +3471,22 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's true is not equal to the given one. + * @throws AssertionError - if the actual Keywords's try is not null. */ - public KeywordsAssert hasTrue(Object expectedTrue) { + public KeywordsAssert hasNullTry() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting true of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting try of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; - // null safe check - Object actualTrue = actual.getTrue(); - if (!Objects.areEqual(actualTrue, expectedTrue)) { - failWithMessage(assertjErrorMessage, actual, expectedTrue, actualTrue); + // check + Object actualTry = actual.getTry(); + if (actualTry != null) { + failWithMessage(assertjErrorMessage, actual, actualTry); } // return the current assertion for method chaining @@ -1619,22 +3516,21 @@ public class KeywordsAssert extends AbstractObjectAssertnull. * @return this assertion object. - * @throws AssertionError - if the actual Keywords's try is not equal to the given one. + * @throws AssertionError - if the actual Keywords's try is null. */ - public KeywordsAssert hasTry(Object expectedTry) { + public KeywordsAssert hasNotNullTry() { // check that actual Keywords we want to make assertions on is not null. isNotNull(); // overrides the default error message with a more explicit one - String assertjErrorMessage = "\nExpecting try of:\n <%s>\nto be:\n <%s>\nbut was:\n <%s>"; + String assertjErrorMessage = "\nExpecting try of:\n <%s>\nto be:\n not-null\nbut was:\n "; - // null safe check + // check Object actualTry = actual.getTry(); - if (!Objects.areEqual(actualTry, expectedTry)) { - failWithMessage(assertjErrorMessage, actual, expectedTry, actualTry); + if (actualTry == null) { + failWithMessage(assertjErrorMessage, actual); } // return the current assertion for method chaining @@ -1664,6 +3560,50 @@ public class KeywordsAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's void is not null. + */ + public KeywordsAssert hasNullVoid() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting void of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Void actualVoid = actual.getVoid(); + if (actualVoid != null) { + failWithMessage(assertjErrorMessage, actual, actualVoid); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's void is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's void is null. + */ + public KeywordsAssert hasNotNullVoid() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting void of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Void actualVoid = actual.getVoid(); + if (actualVoid == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Keywords's volatile is equal to the given one. * @param expectedVolatile the given volatile to compare the actual Keywords's volatile to. @@ -1687,6 +3627,50 @@ public class KeywordsAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's volatile is not null. + */ + public KeywordsAssert hasNullVolatile() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting volatile of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualVolatile = actual.getVolatile(); + if (actualVolatile != null) { + failWithMessage(assertjErrorMessage, actual, actualVolatile); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's volatile is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's volatile is null. + */ + public KeywordsAssert hasNotNullVolatile() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting volatile of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualVolatile = actual.getVolatile(); + if (actualVolatile == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Keywords's while is equal to the given one. * @param expectedWhile the given while to compare the actual Keywords's while to. @@ -1710,4 +3694,48 @@ public class KeywordsAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's while is not null. + */ + public KeywordsAssert hasNullWhile() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting while of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Object actualWhile = actual.getWhile(); + if (actualWhile != null) { + failWithMessage(assertjErrorMessage, actual, actualWhile); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Keywords's while is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Keywords's while is null. + */ + public KeywordsAssert hasNotNullWhile() { + // check that actual Keywords we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting while of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Object actualWhile = actual.getWhile(); + if (actualWhile == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + } diff --git a/src/test/resources/MovieAssert.flat.expected.txt b/src/test/resources/MovieAssert.flat.expected.txt index b105a8b1..831b87e7 100644 --- a/src/test/resources/MovieAssert.flat.expected.txt +++ b/src/test/resources/MovieAssert.flat.expected.txt @@ -52,6 +52,50 @@ public class MovieAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Movie's publicCategory is null. + * @return this assertion object. + * @throws AssertionError - if the actual Movie's publicCategory is not null. + */ + public MovieAssert hasNullPublicCategory() { + // check that actual Movie we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting publicCategory of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Movie.PublicCategory actualPublicCategory = actual.getPublicCategory(); + if (actualPublicCategory != null) { + failWithMessage(assertjErrorMessage, actual, actualPublicCategory); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Movie's publicCategory is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Movie's publicCategory is null. + */ + public MovieAssert hasNotNullPublicCategory() { + // check that actual Movie we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting publicCategory of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Movie.PublicCategory actualPublicCategory = actual.getPublicCategory(); + if (actualPublicCategory == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Movie's releaseDate is equal to the given one. * @param releaseDate the given releaseDate to compare the actual Movie's releaseDate to. @@ -75,6 +119,50 @@ public class MovieAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Movie's releaseDate is null. + * @return this assertion object. + * @throws AssertionError - if the actual Movie's releaseDate is not null. + */ + public MovieAssert hasNullReleaseDate() { + // check that actual Movie we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting releaseDate of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.Date actualReleaseDate = actual.getReleaseDate(); + if (actualReleaseDate != null) { + failWithMessage(assertjErrorMessage, actual, actualReleaseDate); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Movie's releaseDate is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Movie's releaseDate is null. + */ + public MovieAssert hasNotNullReleaseDate() { + // check that actual Movie we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting releaseDate of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.Date actualReleaseDate = actual.getReleaseDate(); + if (actualReleaseDate == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Movie's title is equal to the given one. * @param title the given title to compare the actual Movie's title to. @@ -98,6 +186,50 @@ public class MovieAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Movie's title is null. + * @return this assertion object. + * @throws AssertionError - if the actual Movie's title is not null. + */ + public MovieAssert hasNullTitle() { + // check that actual Movie we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting title of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualTitle = actual.getTitle(); + if (actualTitle != null) { + failWithMessage(assertjErrorMessage, actual, actualTitle); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Movie's title is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Movie's title is null. + */ + public MovieAssert hasNotNullTitle() { + // check that actual Movie we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting title of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualTitle = actual.getTitle(); + if (actualTitle == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Movie's creator is equal to the given one. * @param creator the given creator to compare the actual Movie's creator to. @@ -121,6 +253,50 @@ public class MovieAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Movie's creator is null. + * @return this assertion object. + * @throws AssertionError - if the actual Movie's creator is not null. + */ + public MovieAssert hasNullCreator() { + // check that actual Movie we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting creator of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualCreator = actual.creator; + if (actualCreator != null) { + failWithMessage(assertjErrorMessage, actual, actualCreator); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Movie's creator is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Movie's creator is null. + */ + public MovieAssert hasNotNullCreator() { + // check that actual Movie we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting creator of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualCreator = actual.creator; + if (actualCreator == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Movie's producer is equal to the given one. * @param producer the given producer to compare the actual Movie's producer to. @@ -144,6 +320,50 @@ public class MovieAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Movie's producer is null. + * @return this assertion object. + * @throws AssertionError - if the actual Movie's producer is not null. + */ + public MovieAssert hasNullProducer() { + // check that actual Movie we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting producer of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualProducer = actual.producer; + if (actualProducer != null) { + failWithMessage(assertjErrorMessage, actual, actualProducer); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Movie's producer is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Movie's producer is null. + */ + public MovieAssert hasNotNullProducer() { + // check that actual Movie we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting producer of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualProducer = actual.producer; + if (actualProducer == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Movie's rating is equal to the given one. * @param rating the given rating to compare the actual Movie's rating to. diff --git a/src/test/resources/NameAssert.flat.expected.txt b/src/test/resources/NameAssert.flat.expected.txt index 69591959..21e79877 100644 --- a/src/test/resources/NameAssert.flat.expected.txt +++ b/src/test/resources/NameAssert.flat.expected.txt @@ -51,6 +51,50 @@ public class NameAssert extends AbstractComparableAssert { return this; } + /** + * Verifies that the actual Name's first is null. + * @return this assertion object. + * @throws AssertionError - if the actual Name's first is not null. + */ + public NameAssert hasNullFirst() { + // check that actual Name we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting first of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualFirst = actual.getFirst(); + if (actualFirst != null) { + failWithMessage(assertjErrorMessage, actual, actualFirst); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Name's first is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Name's first is null. + */ + public NameAssert hasNotNullFirst() { + // check that actual Name we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting first of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualFirst = actual.getFirst(); + if (actualFirst == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Name's last is equal to the given one. * @param last the given last to compare the actual Name's last to. @@ -74,4 +118,48 @@ public class NameAssert extends AbstractComparableAssert { return this; } + /** + * Verifies that the actual Name's last is null. + * @return this assertion object. + * @throws AssertionError - if the actual Name's last is not null. + */ + public NameAssert hasNullLast() { + // check that actual Name we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting last of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualLast = actual.getLast(); + if (actualLast != null) { + failWithMessage(assertjErrorMessage, actual, actualLast); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Name's last is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Name's last is null. + */ + public NameAssert hasNotNullLast() { + // check that actual Name we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting last of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualLast = actual.getLast(); + if (actualLast == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + } diff --git a/src/test/resources/NestedClassAssert.template.expected.txt b/src/test/resources/NestedClassAssert.template.expected.txt index 518b6d91..bddef86d 100644 --- a/src/test/resources/NestedClassAssert.template.expected.txt +++ b/src/test/resources/NestedClassAssert.template.expected.txt @@ -51,4 +51,48 @@ public class ${nestedClass}Assert extends AbstractObjectAssert<${nestedClass}Ass return this; } + /** + * Verifies that the actual ${nestedClass}'s name is null. + * @return this assertion object. + * @throws AssertionError - if the actual ${nestedClass}'s name is not null. + */ + public ${nestedClass}Assert hasNullName() { + // check that actual ${nestedClass} we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualName = actual.getName(); + if (actualName != null) { + failWithMessage(assertjErrorMessage, actual, actualName); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual ${nestedClass}'s name is not null. + * @return this assertion object. + * @throws AssertionError - if the actual ${nestedClass}'s name is null. + */ + public ${nestedClass}Assert hasNotNullName() { + // check that actual ${nestedClass} we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualName = actual.getName(); + if (actualName == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + } diff --git a/src/test/resources/NestedClassAssert.template.generated.in.custom.package.expected.txt b/src/test/resources/NestedClassAssert.template.generated.in.custom.package.expected.txt index 4fe1d987..7ac727c7 100644 --- a/src/test/resources/NestedClassAssert.template.generated.in.custom.package.expected.txt +++ b/src/test/resources/NestedClassAssert.template.generated.in.custom.package.expected.txt @@ -52,4 +52,48 @@ public class ${nestedClass}Assert extends AbstractObjectAssert<${nestedClass}Ass return this; } + /** + * Verifies that the actual ${nestedClass}'s name is null. + * @return this assertion object. + * @throws AssertionError - if the actual ${nestedClass}'s name is not null. + */ + public ${nestedClass}Assert hasNullName() { + // check that actual ${nestedClass} we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualName = actual.getName(); + if (actualName != null) { + failWithMessage(assertjErrorMessage, actual, actualName); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual ${nestedClass}'s name is not null. + * @return this assertion object. + * @throws AssertionError - if the actual ${nestedClass}'s name is null. + */ + public ${nestedClass}Assert hasNotNullName() { + // check that actual ${nestedClass} we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualName = actual.getName(); + if (actualName == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + } diff --git a/src/test/resources/ParameterClashWithVariablesAssert.flat.expected.txt b/src/test/resources/ParameterClashWithVariablesAssert.flat.expected.txt index 647d793d..4d9b0300 100644 --- a/src/test/resources/ParameterClashWithVariablesAssert.flat.expected.txt +++ b/src/test/resources/ParameterClashWithVariablesAssert.flat.expected.txt @@ -78,6 +78,50 @@ public class ParameterClashWithVariablesAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual ParameterClashWithVariables's bloodPressure is not null. + */ + public ParameterClashWithVariablesAssert hasNullBloodPressure() { + // check that actual ParameterClashWithVariables we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting bloodPressure of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Double actualBloodPressure = actual.bloodPressure; + if (actualBloodPressure != null) { + failWithMessage(assertjErrorMessage, actual, actualBloodPressure); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual ParameterClashWithVariables's bloodPressure is not null. + * @return this assertion object. + * @throws AssertionError - if the actual ParameterClashWithVariables's bloodPressure is null. + */ + public ParameterClashWithVariablesAssert hasNotNullBloodPressure() { + // check that actual ParameterClashWithVariables we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting bloodPressure of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Double actualBloodPressure = actual.bloodPressure; + if (actualBloodPressure == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual ParameterClashWithVariables's bmi is equal to the given one. * @param bmi the given bmi to compare the actual ParameterClashWithVariables's bmi to. @@ -127,6 +171,50 @@ public class ParameterClashWithVariablesAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual ParameterClashWithVariables's bmi is not null. + */ + public ParameterClashWithVariablesAssert hasNullBmi() { + // check that actual ParameterClashWithVariables we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting bmi of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Float actualBmi = actual.bmi; + if (actualBmi != null) { + failWithMessage(assertjErrorMessage, actual, actualBmi); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual ParameterClashWithVariables's bmi is not null. + * @return this assertion object. + * @throws AssertionError - if the actual ParameterClashWithVariables's bmi is null. + */ + public ParameterClashWithVariablesAssert hasNotNullBmi() { + // check that actual ParameterClashWithVariables we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting bmi of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Float actualBmi = actual.bmi; + if (actualBmi == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual ParameterClashWithVariables's height is equal to the given one. * @param height the given height to compare the actual ParameterClashWithVariables's height to. @@ -199,6 +287,50 @@ public class ParameterClashWithVariablesAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual ParameterClashWithVariables's offset is not null. + */ + public ParameterClashWithVariablesAssert hasNullOffset() { + // check that actual ParameterClashWithVariables we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting offset of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualOffset = actual.offset; + if (actualOffset != null) { + failWithMessage(assertjErrorMessage, actual, actualOffset); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual ParameterClashWithVariables's offset is not null. + * @return this assertion object. + * @throws AssertionError - if the actual ParameterClashWithVariables's offset is null. + */ + public ParameterClashWithVariablesAssert hasNotNullOffset() { + // check that actual ParameterClashWithVariables we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting offset of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualOffset = actual.offset; + if (actualOffset == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual ParameterClashWithVariables's weight is equal to the given one. * @param weight the given weight to compare the actual ParameterClashWithVariables's weight to. diff --git a/src/test/resources/PlayerAgentAssert.flat.expected.txt b/src/test/resources/PlayerAgentAssert.flat.expected.txt index 5b416498..e35b38a7 100644 --- a/src/test/resources/PlayerAgentAssert.flat.expected.txt +++ b/src/test/resources/PlayerAgentAssert.flat.expected.txt @@ -51,4 +51,48 @@ public class PlayerAgentAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual PlayerAgent's managedPlayer is not null. + */ + public PlayerAgentAssert hasNullManagedPlayer() { + // check that actual PlayerAgent we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting managedPlayer of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Player actualManagedPlayer = actual.getManagedPlayer(); + if (actualManagedPlayer != null) { + failWithMessage(assertjErrorMessage, actual, actualManagedPlayer); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual PlayerAgent's managedPlayer is not null. + * @return this assertion object. + * @throws AssertionError - if the actual PlayerAgent's managedPlayer is null. + */ + public PlayerAgentAssert hasNotNullManagedPlayer() { + // check that actual PlayerAgent we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting managedPlayer of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Player actualManagedPlayer = actual.getManagedPlayer(); + if (actualManagedPlayer == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + } diff --git a/src/test/resources/PlayerAgentAssert.generated.in.custom.package.flat.expected.txt b/src/test/resources/PlayerAgentAssert.generated.in.custom.package.flat.expected.txt index caecf78f..5e4abfe6 100644 --- a/src/test/resources/PlayerAgentAssert.generated.in.custom.package.flat.expected.txt +++ b/src/test/resources/PlayerAgentAssert.generated.in.custom.package.flat.expected.txt @@ -52,4 +52,48 @@ public class PlayerAgentAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual PlayerAgent's managedPlayer is not null. + */ + public PlayerAgentAssert hasNullManagedPlayer() { + // check that actual PlayerAgent we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting managedPlayer of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + org.assertj.assertions.generator.data.nba.Player actualManagedPlayer = actual.getManagedPlayer(); + if (actualManagedPlayer != null) { + failWithMessage(assertjErrorMessage, actual, actualManagedPlayer); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual PlayerAgent's managedPlayer is not null. + * @return this assertion object. + * @throws AssertionError - if the actual PlayerAgent's managedPlayer is null. + */ + public PlayerAgentAssert hasNotNullManagedPlayer() { + // check that actual PlayerAgent we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting managedPlayer of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + org.assertj.assertions.generator.data.nba.Player actualManagedPlayer = actual.getManagedPlayer(); + if (actualManagedPlayer == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + } diff --git a/src/test/resources/PlayerAssert.flat.expected.txt b/src/test/resources/PlayerAssert.flat.expected.txt index 012c6bc5..cd585f64 100644 --- a/src/test/resources/PlayerAssert.flat.expected.txt +++ b/src/test/resources/PlayerAssert.flat.expected.txt @@ -148,6 +148,50 @@ public class PlayerAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Player's name is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's name is not null. + */ + public PlayerAssert hasNullName() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + org.assertj.assertions.generator.data.Name actualName = actual.getName(); + if (actualName != null) { + failWithMessage(assertjErrorMessage, actual, actualName); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Player's name is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's name is null. + */ + public PlayerAssert hasNotNullName() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + org.assertj.assertions.generator.data.Name actualName = actual.getName(); + if (actualName == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Player should not play. * @return this assertion object. @@ -336,6 +380,49 @@ public class PlayerAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Player's points is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's points is not null. + */ + public PlayerAssert hasNullPoints() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting points of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualPoints = actual.getPoints(); + if (actualPoints != null) { + failWithMessage(assertjErrorMessage, actual, actualPoints); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Player's points is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's points is null. + */ + public PlayerAssert hasNotNullPoints() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting points of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualPoints = actual.getPoints(); + if (actualPoints == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } /** * Verifies that the actual Player's pointsPerGame is equal to the given one. @@ -443,6 +530,49 @@ public class PlayerAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Player's previousTeamNames is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's previousTeamNames is not null. + */ + public PlayerAssert hasNullPreviousTeamNames() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting previousTeamNames of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String[] actualPreviousTeamNames = actual.getPreviousTeamNames(); + if (actualPreviousTeamNames != null) { + failWithMessage(assertjErrorMessage, actual, actualPreviousTeamNames); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Player's previousTeamNames is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's previousTeamNames is null. + */ + public PlayerAssert hasNotNullPreviousTeamNames() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting previousTeamNames of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String[] actualPreviousTeamNames = actual.getPreviousTeamNames(); + if (actualPreviousTeamNames == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } /** * Verifies that the actual Player's reboundsPerGame is equal to the given one. @@ -611,6 +741,50 @@ public class PlayerAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Player's team is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's team is not null. + */ + public PlayerAssert hasNullTeam() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting team of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualTeam = actual.getTeam(); + if (actualTeam != null) { + failWithMessage(assertjErrorMessage, actual, actualTeam); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Player's team is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's team is null. + */ + public PlayerAssert hasNotNullTeam() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting team of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualTeam = actual.getTeam(); + if (actualTeam == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Player's teamMates contains the given Player elements. * @param teamMates the given elements that should be contained in actual Player's teamMates. @@ -763,6 +937,49 @@ public class PlayerAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Player's teamMates is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's teamMates is not null. + */ + public PlayerAssert hasNullTeamMates() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting teamMates of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualTeamMates = actual.getTeamMates(); + if (actualTeamMates != null) { + failWithMessage(assertjErrorMessage, actual, actualTeamMates); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Player's teamMates is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's teamMates is null. + */ + public PlayerAssert hasNotNullTeamMates() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting teamMates of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualTeamMates = actual.getTeamMates(); + if (actualTeamMates == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } /** * Verifies that the actual Player has trophy. @@ -1060,5 +1277,48 @@ public class PlayerAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Player's previousTeams is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's previousTeams is not null. + */ + public PlayerAssert hasNullPreviousTeams() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting previousTeams of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualPreviousTeams = actual.previousTeams; + if (actualPreviousTeams != null) { + failWithMessage(assertjErrorMessage, actual, actualPreviousTeams); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Player's previousTeams is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's previousTeams is null. + */ + public PlayerAssert hasNotNullPreviousTeams() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting previousTeams of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualPreviousTeams = actual.previousTeams; + if (actualPreviousTeams == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } } diff --git a/src/test/resources/PlayerAssert.generated.in.custom.package.flat.expected.txt b/src/test/resources/PlayerAssert.generated.in.custom.package.flat.expected.txt index 7c144de2..3dddf42c 100644 --- a/src/test/resources/PlayerAssert.generated.in.custom.package.flat.expected.txt +++ b/src/test/resources/PlayerAssert.generated.in.custom.package.flat.expected.txt @@ -149,6 +149,50 @@ public class PlayerAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Player's name is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's name is not null. + */ + public PlayerAssert hasNullName() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + org.assertj.assertions.generator.data.Name actualName = actual.getName(); + if (actualName != null) { + failWithMessage(assertjErrorMessage, actual, actualName); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Player's name is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's name is null. + */ + public PlayerAssert hasNotNullName() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + org.assertj.assertions.generator.data.Name actualName = actual.getName(); + if (actualName == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Player should not play. * @return this assertion object. @@ -337,6 +381,49 @@ public class PlayerAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Player's points is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's points is not null. + */ + public PlayerAssert hasNullPoints() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting points of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualPoints = actual.getPoints(); + if (actualPoints != null) { + failWithMessage(assertjErrorMessage, actual, actualPoints); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Player's points is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's points is null. + */ + public PlayerAssert hasNotNullPoints() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting points of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualPoints = actual.getPoints(); + if (actualPoints == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } /** * Verifies that the actual Player's pointsPerGame is equal to the given one. @@ -444,6 +531,49 @@ public class PlayerAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Player's previousTeamNames is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's previousTeamNames is not null. + */ + public PlayerAssert hasNullPreviousTeamNames() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting previousTeamNames of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String[] actualPreviousTeamNames = actual.getPreviousTeamNames(); + if (actualPreviousTeamNames != null) { + failWithMessage(assertjErrorMessage, actual, actualPreviousTeamNames); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Player's previousTeamNames is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's previousTeamNames is null. + */ + public PlayerAssert hasNotNullPreviousTeamNames() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting previousTeamNames of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String[] actualPreviousTeamNames = actual.getPreviousTeamNames(); + if (actualPreviousTeamNames == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } /** * Verifies that the actual Player's reboundsPerGame is equal to the given one. @@ -612,6 +742,50 @@ public class PlayerAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Player's team is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's team is not null. + */ + public PlayerAssert hasNullTeam() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting team of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualTeam = actual.getTeam(); + if (actualTeam != null) { + failWithMessage(assertjErrorMessage, actual, actualTeam); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Player's team is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's team is null. + */ + public PlayerAssert hasNotNullTeam() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting team of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualTeam = actual.getTeam(); + if (actualTeam == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Player's teamMates contains the given Player elements. * @param teamMates the given elements that should be contained in actual Player's teamMates. @@ -764,6 +938,49 @@ public class PlayerAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Player's teamMates is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's teamMates is not null. + */ + public PlayerAssert hasNullTeamMates() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting teamMates of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualTeamMates = actual.getTeamMates(); + if (actualTeamMates != null) { + failWithMessage(assertjErrorMessage, actual, actualTeamMates); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Player's teamMates is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's teamMates is null. + */ + public PlayerAssert hasNotNullTeamMates() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting teamMates of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualTeamMates = actual.getTeamMates(); + if (actualTeamMates == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } /** * Verifies that the actual Player has trophy. @@ -1061,5 +1278,48 @@ public class PlayerAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Player's previousTeams is null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's previousTeams is not null. + */ + public PlayerAssert hasNullPreviousTeams() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting previousTeams of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualPreviousTeams = actual.previousTeams; + if (actualPreviousTeams != null) { + failWithMessage(assertjErrorMessage, actual, actualPreviousTeams); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Player's previousTeams is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Player's previousTeams is null. + */ + public PlayerAssert hasNotNullPreviousTeams() { + // check that actual Player we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting previousTeams of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualPreviousTeams = actual.previousTeams; + if (actualPreviousTeams == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } } diff --git a/src/test/resources/PrimitivesAssert.flat.expected.txt b/src/test/resources/PrimitivesAssert.flat.expected.txt index a63acce8..31d5e77a 100644 --- a/src/test/resources/PrimitivesAssert.flat.expected.txt +++ b/src/test/resources/PrimitivesAssert.flat.expected.txt @@ -147,6 +147,50 @@ public class PrimitivesAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's byteWrapper is not null. + */ + public PrimitivesAssert hasNullByteWrapper() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting byteWrapper of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Byte actualByteWrapper = actual.getByteWrapper(); + if (actualByteWrapper != null) { + failWithMessage(assertjErrorMessage, actual, actualByteWrapper); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Primitives's byteWrapper is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's byteWrapper is null. + */ + public PrimitivesAssert hasNotNullByteWrapper() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting byteWrapper of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Byte actualByteWrapper = actual.getByteWrapper(); + if (actualByteWrapper == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Primitives's char is equal to the given one. * @param expectedChar the given char to compare the actual Primitives's char to. @@ -193,6 +237,50 @@ public class PrimitivesAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's character is not null. + */ + public PrimitivesAssert hasNullCharacter() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting character of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Character actualCharacter = actual.getCharacter(); + if (actualCharacter != null) { + failWithMessage(assertjErrorMessage, actual, actualCharacter); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Primitives's character is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's character is null. + */ + public PrimitivesAssert hasNotNullCharacter() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting character of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Character actualCharacter = actual.getCharacter(); + if (actualCharacter == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Primitives's double is equal to the given one. * @param expectedDouble the given double to compare the actual Primitives's double to. @@ -291,6 +379,50 @@ public class PrimitivesAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's doubleWrapper is not null. + */ + public PrimitivesAssert hasNullDoubleWrapper() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting doubleWrapper of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Double actualDoubleWrapper = actual.getDoubleWrapper(); + if (actualDoubleWrapper != null) { + failWithMessage(assertjErrorMessage, actual, actualDoubleWrapper); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Primitives's doubleWrapper is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's doubleWrapper is null. + */ + public PrimitivesAssert hasNotNullDoubleWrapper() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting doubleWrapper of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Double actualDoubleWrapper = actual.getDoubleWrapper(); + if (actualDoubleWrapper == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Primitives is enabled. * @return this assertion object. @@ -425,6 +557,50 @@ public class PrimitivesAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's floatWrapper is not null. + */ + public PrimitivesAssert hasNullFloatWrapper() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting floatWrapper of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Float actualFloatWrapper = actual.getFloatWrapper(); + if (actualFloatWrapper != null) { + failWithMessage(assertjErrorMessage, actual, actualFloatWrapper); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Primitives's floatWrapper is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's floatWrapper is null. + */ + public PrimitivesAssert hasNotNullFloatWrapper() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting floatWrapper of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Float actualFloatWrapper = actual.getFloatWrapper(); + if (actualFloatWrapper == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Primitives's int is equal to the given one. * @param expectedInt the given int to compare the actual Primitives's int to. @@ -471,6 +647,50 @@ public class PrimitivesAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's integer is not null. + */ + public PrimitivesAssert hasNullInteger() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting integer of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Integer actualInteger = actual.getInteger(); + if (actualInteger != null) { + failWithMessage(assertjErrorMessage, actual, actualInteger); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Primitives's integer is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's integer is null. + */ + public PrimitivesAssert hasNotNullInteger() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting integer of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Integer actualInteger = actual.getInteger(); + if (actualInteger == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Primitives's long is equal to the given one. * @param expectedLong the given long to compare the actual Primitives's long to. @@ -517,6 +737,50 @@ public class PrimitivesAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's longWrapper is not null. + */ + public PrimitivesAssert hasNullLongWrapper() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting longWrapper of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Long actualLongWrapper = actual.getLongWrapper(); + if (actualLongWrapper != null) { + failWithMessage(assertjErrorMessage, actual, actualLongWrapper); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Primitives's longWrapper is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's longWrapper is null. + */ + public PrimitivesAssert hasNotNullLongWrapper() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting longWrapper of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Long actualLongWrapper = actual.getLongWrapper(); + if (actualLongWrapper == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Primitives's short is equal to the given one. * @param expectedShort the given short to compare the actual Primitives's short to. @@ -563,4 +827,48 @@ public class PrimitivesAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's shortWrapper is not null. + */ + public PrimitivesAssert hasNullShortWrapper() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting shortWrapper of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + Short actualShortWrapper = actual.getShortWrapper(); + if (actualShortWrapper != null) { + failWithMessage(assertjErrorMessage, actual, actualShortWrapper); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Primitives's shortWrapper is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Primitives's shortWrapper is null. + */ + public PrimitivesAssert hasNotNullShortWrapper() { + // check that actual Primitives we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting shortWrapper of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + Short actualShortWrapper = actual.getShortWrapper(); + if (actualShortWrapper == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + } diff --git a/src/test/resources/TeamAssert.flat.expected.txt b/src/test/resources/TeamAssert.flat.expected.txt index 3b67173d..8fe8ee25 100644 --- a/src/test/resources/TeamAssert.flat.expected.txt +++ b/src/test/resources/TeamAssert.flat.expected.txt @@ -53,6 +53,50 @@ public class TeamAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Team's division is null. + * @return this assertion object. + * @throws AssertionError - if the actual Team's division is not null. + */ + public TeamAssert hasNullDivision() { + // check that actual Team we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting division of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualDivision = actual.getDivision(); + if (actualDivision != null) { + failWithMessage(assertjErrorMessage, actual, actualDivision); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Team's division is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Team's division is null. + */ + public TeamAssert hasNotNullDivision() { + // check that actual Team we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting division of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualDivision = actual.getDivision(); + if (actualDivision == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Team's name is equal to the given one. * @param name the given name to compare the actual Team's name to. @@ -76,6 +120,50 @@ public class TeamAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Team's name is null. + * @return this assertion object. + * @throws AssertionError - if the actual Team's name is not null. + */ + public TeamAssert hasNullName() { + // check that actual Team we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualName = actual.name; + if (actualName != null) { + failWithMessage(assertjErrorMessage, actual, actualName); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Team's name is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Team's name is null. + */ + public TeamAssert hasNotNullName() { + // check that actual Team we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualName = actual.name; + if (actualName == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual Team's oldNames contains the given String elements. * @param oldNames the given elements that should be contained in actual Team's oldNames. @@ -159,6 +247,49 @@ public class TeamAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Team's oldNames is null. + * @return this assertion object. + * @throws AssertionError - if the actual Team's oldNames is not null. + */ + public TeamAssert hasNullOldNames() { + // check that actual Team we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting oldNames of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String[] actualOldNames = actual.oldNames; + if (actualOldNames != null) { + failWithMessage(assertjErrorMessage, actual, actualOldNames); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Team's oldNames is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Team's oldNames is null. + */ + public TeamAssert hasNotNullOldNames() { + // check that actual Team we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting oldNames of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String[] actualOldNames = actual.oldNames; + if (actualOldNames == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } /** * Verifies that the actual Team's players contains the given org.assertj.assertions.generator.data.nba.Player elements. @@ -312,6 +443,49 @@ public class TeamAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Team's players is null. + * @return this assertion object. + * @throws AssertionError - if the actual Team's players is not null. + */ + public TeamAssert hasNullPlayers() { + // check that actual Team we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting players of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualPlayers = actual.players; + if (actualPlayers != null) { + failWithMessage(assertjErrorMessage, actual, actualPlayers); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Team's players is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Team's players is null. + */ + public TeamAssert hasNotNullPlayers() { + // check that actual Team we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting players of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualPlayers = actual.players; + if (actualPlayers == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } /** * Verifies that the actual Team's points contains the given int[] elements. @@ -465,6 +639,49 @@ public class TeamAssert extends AbstractObjectAssert { return this; } + /** + * Verifies that the actual Team's points is null. + * @return this assertion object. + * @throws AssertionError - if the actual Team's points is not null. + */ + public TeamAssert hasNullPoints() { + // check that actual Team we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting points of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + java.util.List actualPoints = actual.points; + if (actualPoints != null) { + failWithMessage(assertjErrorMessage, actual, actualPoints); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual Team's points is not null. + * @return this assertion object. + * @throws AssertionError - if the actual Team's points is null. + */ + public TeamAssert hasNotNullPoints() { + // check that actual Team we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting points of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + java.util.List actualPoints = actual.points; + if (actualPoints == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } /** * Verifies that the actual Team's rank is equal to the given one. diff --git a/src/test/resources/WithPrivateFieldsAssert.flat.expected.txt b/src/test/resources/WithPrivateFieldsAssert.flat.expected.txt index 1371067b..6e6fc6bc 100644 --- a/src/test/resources/WithPrivateFieldsAssert.flat.expected.txt +++ b/src/test/resources/WithPrivateFieldsAssert.flat.expected.txt @@ -51,6 +51,50 @@ public class WithPrivateFieldsAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual WithPrivateFields's address is not null. + */ + public WithPrivateFieldsAssert hasNullAddress() { + // check that actual WithPrivateFields we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting address of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualAddress = actual.getAddress(); + if (actualAddress != null) { + failWithMessage(assertjErrorMessage, actual, actualAddress); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual WithPrivateFields's address is not null. + * @return this assertion object. + * @throws AssertionError - if the actual WithPrivateFields's address is null. + */ + public WithPrivateFieldsAssert hasNotNullAddress() { + // check that actual WithPrivateFields we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting address of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualAddress = actual.getAddress(); + if (actualAddress == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual WithPrivateFields's city is equal to the given one. * @param city the given city to compare the actual WithPrivateFields's city to. @@ -74,6 +118,50 @@ public class WithPrivateFieldsAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual WithPrivateFields's city is not null. + */ + public WithPrivateFieldsAssert hasNullCity() { + // check that actual WithPrivateFields we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting city of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualCity = actual.getCity(); + if (actualCity != null) { + failWithMessage(assertjErrorMessage, actual, actualCity); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual WithPrivateFields's city is not null. + * @return this assertion object. + * @throws AssertionError - if the actual WithPrivateFields's city is null. + */ + public WithPrivateFieldsAssert hasNotNullCity() { + // check that actual WithPrivateFields we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting city of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualCity = actual.getCity(); + if (actualCity == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual WithPrivateFields's age is equal to the given one. * @param age the given age to compare the actual WithPrivateFields's age to. @@ -120,6 +208,50 @@ public class WithPrivateFieldsAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual WithPrivateFields's country is not null. + */ + public WithPrivateFieldsAssert hasNullCountry() { + // check that actual WithPrivateFields we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting country of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualCountry = org.assertj.core.util.introspection.FieldSupport.EXTRACTION.fieldValue("country", String.class, actual); + if (actualCountry != null) { + failWithMessage(assertjErrorMessage, actual, actualCountry); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual WithPrivateFields's country is not null. + * @return this assertion object. + * @throws AssertionError - if the actual WithPrivateFields's country is null. + */ + public WithPrivateFieldsAssert hasNotNullCountry() { + // check that actual WithPrivateFields we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting country of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualCountry = org.assertj.core.util.introspection.FieldSupport.EXTRACTION.fieldValue("country", String.class, actual); + if (actualCountry == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual WithPrivateFields is minor. * @return this assertion object. @@ -179,6 +311,50 @@ public class WithPrivateFieldsAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual WithPrivateFields's name is not null. + */ + public WithPrivateFieldsAssert hasNullName() { + // check that actual WithPrivateFields we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualName = org.assertj.core.util.introspection.FieldSupport.EXTRACTION.fieldValue("name", String.class, actual); + if (actualName != null) { + failWithMessage(assertjErrorMessage, actual, actualName); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual WithPrivateFields's name is not null. + * @return this assertion object. + * @throws AssertionError - if the actual WithPrivateFields's name is null. + */ + public WithPrivateFieldsAssert hasNotNullName() { + // check that actual WithPrivateFields we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting name of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualName = org.assertj.core.util.introspection.FieldSupport.EXTRACTION.fieldValue("name", String.class, actual); + if (actualName == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual WithPrivateFields's nickname is equal to the given one. * @param nickname the given nickname to compare the actual WithPrivateFields's nickname to. @@ -202,6 +378,50 @@ public class WithPrivateFieldsAssert extends AbstractObjectAssertnull. + * @return this assertion object. + * @throws AssertionError - if the actual WithPrivateFields's nickname is not null. + */ + public WithPrivateFieldsAssert hasNullNickname() { + // check that actual WithPrivateFields we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting nickname of:\n <%s>\nto be:\n null\nbut was:\n <%s>"; + + // check + String actualNickname = org.assertj.core.util.introspection.FieldSupport.EXTRACTION.fieldValue("nickname", String.class, actual); + if (actualNickname != null) { + failWithMessage(assertjErrorMessage, actual, actualNickname); + } + + // return the current assertion for method chaining + return this; + } + + /** + * Verifies that the actual WithPrivateFields's nickname is not null. + * @return this assertion object. + * @throws AssertionError - if the actual WithPrivateFields's nickname is null. + */ + public WithPrivateFieldsAssert hasNotNullNickname() { + // check that actual WithPrivateFields we want to make assertions on is not null. + isNotNull(); + + // overrides the default error message with a more explicit one + String assertjErrorMessage = "\nExpecting nickname of:\n <%s>\nto be:\n not-null\nbut was:\n "; + + // check + String actualNickname = org.assertj.core.util.introspection.FieldSupport.EXTRACTION.fieldValue("nickname", String.class, actual); + if (actualNickname == null) { + failWithMessage(assertjErrorMessage, actual); + } + + // return the current assertion for method chaining + return this; + } + /** * Verifies that the actual WithPrivateFields is northernHemisphere. * @return this assertion object.