Class Assert
java.lang.Object
nl.jqno.equalsverifier.internal.util.Assert
Alternative for org.junit.Assert, so we can assert things without having a dependency on JUnit.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertEquals(Formatter message, Object expected, Object actual) Asserts that two Objects are equal to one another.static voidassertFalse(Formatter message, boolean assertion) Asserts that an assertion is true.static voidassertTrue(Formatter message, boolean assertion) Asserts that an assertion is false.static voidThrows an AssertionException.static voidThrows an AssertionException.
-
Method Details
-
assertEquals
Asserts that two Objects are equal to one another. Does nothing if they are; throws an AssertionException if they're not.- Parameters:
message- Message to be included in theAssertionException.expected- Expected value.actual- Actual value.- Throws:
AssertionException- Ifexpectedandactualare not equal.
-
assertFalse
Asserts that an assertion is true. Does nothing if it is; throws an AssertionException if it isn't.- Parameters:
message- Message to be included in theAssertionException.assertion- Assertion that must be true.- Throws:
AssertionException- Ifassertionis false.
-
assertTrue
Asserts that an assertion is false. Does nothing if it is; throws an AssertionException if it isn't.- Parameters:
message- Message to be included in theAssertionException.assertion- Assertion that must be true.- Throws:
AssertionException- Ifassertionis false.
-
fail
Throws an AssertionException.- Parameters:
message- Message to be included in theAssertionException.- Throws:
AssertionException- Always.
-
fail
Throws an AssertionException.- Parameters:
message- Message to be included in theAssertionException.cause- Throwable to be included as cause in theAssertionException. Can be null.- Throws:
AssertionException- Always.
-