Class Assertions
- java.lang.Object
-
- org.junit.jupiter.api.Assertions
-
@API(status=STABLE, since="5.0") public class Assertions extends java.lang.ObjectAssertionsis a collection of utility methods that support asserting conditions in tests.Unless otherwise noted, a failed assertion will throw an
AssertionFailedErroror a subclass thereof.Kotlin Support
Additional Kotlin assertions can be found as top-level functions in the
org.junit.jupiter.apipackage.Preemptive Timeouts
The various
assertTimeoutPreemptively()methods in this class execute the providedexecutableorsupplierin a different thread than that of the calling code. This behavior can lead to undesirable side effects if the code that is executed within theexecutableorsupplierrelies onThreadLocalstorage.One common example of this is the transactional testing support in the Spring Framework. Specifically, Spring's testing support binds transaction state to the current thread (via a
ThreadLocal) before a test method is invoked. Consequently, if anexecutableorsupplierprovided toassertTimeoutPreemptively()invokes Spring-managed components that participate in transactions, any actions taken by those components will not be rolled back with the test-managed transaction. On the contrary, such actions will be committed to the persistent store (e.g., relational database) even though the test-managed transaction is rolled back.Similar side effects may be encountered with other frameworks that rely on
ThreadLocalstorage.Extensibility
Although it is technically possible to extend this class, extension is strongly discouraged. The JUnit Team highly recommends that the methods defined in this class be used via static imports.
- Since:
- 5.0
- See Also:
AssertionFailedError,Assumptions
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAssertions()Protected constructor allowing subclassing but not direct instantiation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidassertAll(java.lang.String heading, java.util.Collection<Executable> executables)Assert that all suppliedexecutablesdo not throw exceptions.static voidassertAll(java.lang.String heading, java.util.stream.Stream<Executable> executables)Assert that all suppliedexecutablesdo not throw exceptions.static voidassertAll(java.lang.String heading, Executable... executables)Assert that all suppliedexecutablesdo not throw exceptions.static voidassertAll(java.util.Collection<Executable> executables)Assert that all suppliedexecutablesdo not throw exceptions.static voidassertAll(java.util.stream.Stream<Executable> executables)Assert that all suppliedexecutablesdo not throw exceptions.static voidassertAll(Executable... executables)Assert that all suppliedexecutablesdo not throw exceptions.static voidassertArrayEquals(boolean[] expected, boolean[] actual)Assert thatexpectedandactualboolean arrays are equal.static voidassertArrayEquals(boolean[] expected, boolean[] actual, java.lang.String message)Assert thatexpectedandactualboolean arrays are equal.static voidassertArrayEquals(boolean[] expected, boolean[] actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualboolean arrays are equal.static voidassertArrayEquals(byte[] expected, byte[] actual)Assert thatexpectedandactualbyte arrays are equal.static voidassertArrayEquals(byte[] expected, byte[] actual, java.lang.String message)Assert thatexpectedandactualbyte arrays are equal.static voidassertArrayEquals(byte[] expected, byte[] actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualbyte arrays are equal.static voidassertArrayEquals(char[] expected, char[] actual)Assert thatexpectedandactualchar arrays are equal.static voidassertArrayEquals(char[] expected, char[] actual, java.lang.String message)Assert thatexpectedandactualchar arrays are equal.static voidassertArrayEquals(char[] expected, char[] actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualchar arrays are equal.static voidassertArrayEquals(double[] expected, double[] actual)Assert thatexpectedandactualdouble arrays are equal.static voidassertArrayEquals(double[] expected, double[] actual, double delta)Assert thatexpectedandactualdouble arrays are equal within the given non-negativedelta.static voidassertArrayEquals(double[] expected, double[] actual, double delta, java.lang.String message)Assert thatexpectedandactualdouble arrays are equal within the given non-negativedelta.static voidassertArrayEquals(double[] expected, double[] actual, double delta, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualdouble arrays are equal within the given non-negativedelta.static voidassertArrayEquals(double[] expected, double[] actual, java.lang.String message)Assert thatexpectedandactualdouble arrays are equal.static voidassertArrayEquals(double[] expected, double[] actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualdouble arrays are equal.static voidassertArrayEquals(float[] expected, float[] actual)Assert thatexpectedandactualfloat arrays are equal.static voidassertArrayEquals(float[] expected, float[] actual, float delta)Assert thatexpectedandactualfloat arrays are equal within the given non-negativedelta.static voidassertArrayEquals(float[] expected, float[] actual, float delta, java.lang.String message)Assert thatexpectedandactualfloat arrays are equal within the given non-negativedelta.static voidassertArrayEquals(float[] expected, float[] actual, float delta, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualfloat arrays are equal within the given non-negativedelta.static voidassertArrayEquals(float[] expected, float[] actual, java.lang.String message)Assert thatexpectedandactualfloat arrays are equal.static voidassertArrayEquals(float[] expected, float[] actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualfloat arrays are equal.static voidassertArrayEquals(int[] expected, int[] actual)Assert thatexpectedandactualint arrays are equal.static voidassertArrayEquals(int[] expected, int[] actual, java.lang.String message)Assert thatexpectedandactualint arrays are equal.static voidassertArrayEquals(int[] expected, int[] actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualint arrays are equal.static voidassertArrayEquals(long[] expected, long[] actual)Assert thatexpectedandactuallong arrays are equal.static voidassertArrayEquals(long[] expected, long[] actual, java.lang.String message)Assert thatexpectedandactuallong arrays are equal.static voidassertArrayEquals(long[] expected, long[] actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactuallong arrays are equal.static voidassertArrayEquals(short[] expected, short[] actual)Assert thatexpectedandactualshort arrays are equal.static voidassertArrayEquals(short[] expected, short[] actual, java.lang.String message)Assert thatexpectedandactualshort arrays are equal.static voidassertArrayEquals(short[] expected, short[] actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualshort arrays are equal.static voidassertArrayEquals(java.lang.Object[] expected, java.lang.Object[] actual)Assert thatexpectedandactualobject arrays are deeply equal.static voidassertArrayEquals(java.lang.Object[] expected, java.lang.Object[] actual, java.lang.String message)Assert thatexpectedandactualobject arrays are deeply equal.static voidassertArrayEquals(java.lang.Object[] expected, java.lang.Object[] actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualobject arrays are deeply equal.static voidassertDoesNotThrow(Executable executable)Assert that execution of the suppliedexecutabledoes not throw any kind of exception.static voidassertDoesNotThrow(Executable executable, java.lang.String message)Assert that execution of the suppliedexecutabledoes not throw any kind of exception.static voidassertDoesNotThrow(Executable executable, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that execution of the suppliedexecutabledoes not throw any kind of exception.static <T> TassertDoesNotThrow(ThrowingSupplier<T> supplier)Assert that execution of the suppliedsupplierdoes not throw any kind of exception.static <T> TassertDoesNotThrow(ThrowingSupplier<T> supplier, java.lang.String message)Assert that execution of the suppliedsupplierdoes not throw any kind of exception.static <T> TassertDoesNotThrow(ThrowingSupplier<T> supplier, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that execution of the suppliedsupplierdoes not throw any kind of exception.static voidassertEquals(byte expected, byte actual)Assert thatexpectedandactualare equal.static voidassertEquals(byte expected, byte actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(byte expected, byte actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(byte expected, java.lang.Byte actual)Assert thatexpectedandactualare equal.static voidassertEquals(byte expected, java.lang.Byte actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(byte expected, java.lang.Byte actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(char expected, char actual)Assert thatexpectedandactualare equal.static voidassertEquals(char expected, char actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(char expected, char actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(char expected, java.lang.Character actual)Assert thatexpectedandactualare equal.static voidassertEquals(char expected, java.lang.Character actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(char expected, java.lang.Character actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(double expected, double actual)Assert thatexpectedandactualare equal.static voidassertEquals(double expected, double actual, double delta)Assert thatexpectedandactualare equal within the given non-negativedelta.static voidassertEquals(double expected, double actual, double delta, java.lang.String message)Assert thatexpectedandactualare equal within the given non-negativedelta.static voidassertEquals(double expected, double actual, double delta, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal within the given non-negativedelta.static voidassertEquals(double expected, double actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(double expected, double actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(double expected, java.lang.Double actual)Assert thatexpectedandactualare equal.static voidassertEquals(double expected, java.lang.Double actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(double expected, java.lang.Double actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(float expected, float actual)Assert thatexpectedandactualare equal.static voidassertEquals(float expected, float actual, float delta)Assert thatexpectedandactualare equal within the given non-negativedelta.static voidassertEquals(float expected, float actual, float delta, java.lang.String message)Assert thatexpectedandactualare equal within the given non-negativedelta.static voidassertEquals(float expected, float actual, float delta, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal within the given non-negativedelta.static voidassertEquals(float expected, float actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(float expected, float actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(float expected, java.lang.Float actual)Assert thatexpectedandactualare equal.static voidassertEquals(float expected, java.lang.Float actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(float expected, java.lang.Float actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(int expected, int actual)Assert thatexpectedandactualare equal.static voidassertEquals(int expected, int actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(int expected, int actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(int expected, java.lang.Integer actual)Assert thatexpectedandactualare equal.static voidassertEquals(int expected, java.lang.Integer actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(int expected, java.lang.Integer actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(long expected, long actual)Assert thatexpectedandactualare equal.static voidassertEquals(long expected, long actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(long expected, long actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(long expected, java.lang.Long actual)Assert thatexpectedandactualare equal.static voidassertEquals(long expected, java.lang.Long actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(long expected, java.lang.Long actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(short expected, short actual)Assert thatexpectedandactualare equal.static voidassertEquals(short expected, short actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(short expected, short actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(short expected, java.lang.Short actual)Assert thatexpectedandactualare equal.static voidassertEquals(short expected, java.lang.Short actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(short expected, java.lang.Short actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Byte expected, byte actual)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Byte expected, byte actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Byte expected, byte actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Byte expected, java.lang.Byte actual)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Byte expected, java.lang.Byte actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Byte expected, java.lang.Byte actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Character expected, char actual)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Character expected, char actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Character expected, char actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Character expected, java.lang.Character actual)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Character expected, java.lang.Character actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Character expected, java.lang.Character actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Double expected, double actual)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Double expected, double actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Double expected, double actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Double expected, java.lang.Double actual)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Double expected, java.lang.Double actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Double expected, java.lang.Double actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Float expected, float actual)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Float expected, float actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Float expected, float actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Float expected, java.lang.Float actual)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Float expected, java.lang.Float actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Float expected, java.lang.Float actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Integer expected, int actual)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Integer expected, int actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Integer expected, int actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Integer expected, java.lang.Integer actual)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Integer expected, java.lang.Integer actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Integer expected, java.lang.Integer actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Long expected, long actual)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Long expected, long actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Long expected, long actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Long expected, java.lang.Long actual)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Long expected, java.lang.Long actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Long expected, java.lang.Long actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Object expected, java.lang.Object actual)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Object expected, java.lang.Object actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Object expected, java.lang.Object actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Short expected, short actual)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Short expected, short actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Short expected, short actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Short expected, java.lang.Short actual)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Short expected, java.lang.Short actual, java.lang.String message)Assert thatexpectedandactualare equal.static voidassertEquals(java.lang.Short expected, java.lang.Short actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.static voidassertFalse(boolean condition)Assert that the suppliedconditionisfalse.static voidassertFalse(boolean condition, java.lang.String message)Assert that the suppliedconditionisfalse.static voidassertFalse(boolean condition, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that the suppliedconditionisfalse.static voidassertFalse(java.util.function.BooleanSupplier booleanSupplier)Assert that the boolean condition supplied bybooleanSupplierisfalse.static voidassertFalse(java.util.function.BooleanSupplier booleanSupplier, java.lang.String message)Assert that the boolean condition supplied bybooleanSupplierisfalse.static voidassertFalse(java.util.function.BooleanSupplier booleanSupplier, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that the boolean condition supplied bybooleanSupplierisfalse.static voidassertIterableEquals(java.lang.Iterable<?> expected, java.lang.Iterable<?> actual)Assert thatexpectedandactualiterables are deeply equal.static voidassertIterableEquals(java.lang.Iterable<?> expected, java.lang.Iterable<?> actual, java.lang.String message)Assert thatexpectedandactualiterables are deeply equal.static voidassertIterableEquals(java.lang.Iterable<?> expected, java.lang.Iterable<?> actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualiterables are deeply equal.static voidassertLinesMatch(java.util.List<java.lang.String> expectedLines, java.util.List<java.lang.String> actualLines)Assert thatexpectedlist of Strings matchesactuallist.static voidassertLinesMatch(java.util.List<java.lang.String> expectedLines, java.util.List<java.lang.String> actualLines, java.lang.String message)Assert thatexpectedlist of Strings matchesactuallist.static voidassertLinesMatch(java.util.List<java.lang.String> expectedLines, java.util.List<java.lang.String> actualLines, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedlist of Strings matchesactuallist.static voidassertNotEquals(byte unexpected, byte actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(byte unexpected, byte actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(byte unexpected, byte actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(byte unexpected, java.lang.Byte actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(byte unexpected, java.lang.Byte actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(byte unexpected, java.lang.Byte actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(char unexpected, char actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(char unexpected, char actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(char unexpected, char actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(char unexpected, java.lang.Character actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(char unexpected, java.lang.Character actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(char unexpected, java.lang.Character actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(double unexpected, double actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(double unexpected, double actual, double delta)Assert thatexpectedandactualare not equal within the givendelta.static voidassertNotEquals(double unexpected, double actual, double delta, java.lang.String message)Assert thatexpectedandactualare not equal within the givendelta.static voidassertNotEquals(double unexpected, double actual, double delta, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal within the givendelta.static voidassertNotEquals(double unexpected, double actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(double unexpected, double actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(double unexpected, java.lang.Double actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(double unexpected, java.lang.Double actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(double unexpected, java.lang.Double actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(float unexpected, float actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(float unexpected, float actual, float delta)Assert thatexpectedandactualare not equal within the givendelta.static voidassertNotEquals(float unexpected, float actual, float delta, java.lang.String message)Assert thatexpectedandactualare not equal within the givendelta.static voidassertNotEquals(float unexpected, float actual, float delta, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal within the givendelta.static voidassertNotEquals(float unexpected, float actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(float unexpected, float actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(float unexpected, java.lang.Float actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(float unexpected, java.lang.Float actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(float unexpected, java.lang.Float actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(int unexpected, int actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(int unexpected, int actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(int unexpected, int actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(int unexpected, java.lang.Integer actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(int unexpected, java.lang.Integer actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(int unexpected, java.lang.Integer actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(long unexpected, long actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(long unexpected, long actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(long unexpected, long actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(long unexpected, java.lang.Long actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(long unexpected, java.lang.Long actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(long unexpected, java.lang.Long actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(short unexpected, short actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(short unexpected, short actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(short unexpected, short actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(short unexpected, java.lang.Short actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(short unexpected, java.lang.Short actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(short unexpected, java.lang.Short actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Byte unexpected, byte actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Byte unexpected, byte actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Byte unexpected, byte actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Byte unexpected, java.lang.Byte actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Byte unexpected, java.lang.Byte actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Byte unexpected, java.lang.Byte actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Character unexpected, char actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Character unexpected, char actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Character unexpected, char actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Character unexpected, java.lang.Character actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Character unexpected, java.lang.Character actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Character unexpected, java.lang.Character actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Double unexpected, double actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Double unexpected, double actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Double unexpected, double actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Double unexpected, java.lang.Double actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Double unexpected, java.lang.Double actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Double unexpected, java.lang.Double actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Float unexpected, float actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Float unexpected, float actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Float unexpected, float actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Float unexpected, java.lang.Float actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Float unexpected, java.lang.Float actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Float unexpected, java.lang.Float actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Integer unexpected, int actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Integer unexpected, int actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Integer unexpected, int actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Integer unexpected, java.lang.Integer actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Integer unexpected, java.lang.Integer actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Integer unexpected, java.lang.Integer actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Long unexpected, long actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Long unexpected, long actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Long unexpected, long actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Long unexpected, java.lang.Long actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Long unexpected, java.lang.Long actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Long unexpected, java.lang.Long actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Object unexpected, java.lang.Object actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Object unexpected, java.lang.Object actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Object unexpected, java.lang.Object actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Short unexpected, short actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Short unexpected, short actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Short unexpected, short actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Short unexpected, java.lang.Short actual)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Short unexpected, java.lang.Short actual, java.lang.String message)Assert thatexpectedandactualare not equal.static voidassertNotEquals(java.lang.Short unexpected, java.lang.Short actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.static voidassertNotNull(java.lang.Object actual)Assert thatactualis notnull.static voidassertNotNull(java.lang.Object actual, java.lang.String message)Assert thatactualis notnull.static voidassertNotNull(java.lang.Object actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatactualis notnull.static voidassertNotSame(java.lang.Object unexpected, java.lang.Object actual)Assert thatexpectedandactualdo not refer to the same object.static voidassertNotSame(java.lang.Object unexpected, java.lang.Object actual, java.lang.String message)Assert thatexpectedandactualdo not refer to the same object.static voidassertNotSame(java.lang.Object unexpected, java.lang.Object actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualdo not refer to the same object.static voidassertNull(java.lang.Object actual)Assert thatactualisnull.static voidassertNull(java.lang.Object actual, java.lang.String message)Assert thatactualisnull.static voidassertNull(java.lang.Object actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatactualisnull.static voidassertSame(java.lang.Object expected, java.lang.Object actual)Assert thatexpectedandactualrefer to the same object.static voidassertSame(java.lang.Object expected, java.lang.Object actual, java.lang.String message)Assert thatexpectedandactualrefer to the same object.static voidassertSame(java.lang.Object expected, java.lang.Object actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualrefer to the same object.static <T extends java.lang.Throwable>
TassertThrows(java.lang.Class<T> expectedType, Executable executable)Assert that execution of the suppliedexecutablethrows an exception of theexpectedTypeand return the exception.static <T extends java.lang.Throwable>
TassertThrows(java.lang.Class<T> expectedType, Executable executable, java.lang.String message)Assert that execution of the suppliedexecutablethrows an exception of theexpectedTypeand return the exception.static <T extends java.lang.Throwable>
TassertThrows(java.lang.Class<T> expectedType, Executable executable, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that execution of the suppliedexecutablethrows an exception of theexpectedTypeand return the exception.static voidassertTimeout(java.time.Duration timeout, Executable executable)Assert that execution of the suppliedexecutablecompletes before the giventimeoutis exceeded.static voidassertTimeout(java.time.Duration timeout, Executable executable, java.lang.String message)Assert that execution of the suppliedexecutablecompletes before the giventimeoutis exceeded.static voidassertTimeout(java.time.Duration timeout, Executable executable, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that execution of the suppliedexecutablecompletes before the giventimeoutis exceeded.static <T> TassertTimeout(java.time.Duration timeout, ThrowingSupplier<T> supplier)Assert that execution of the suppliedsuppliercompletes before the giventimeoutis exceeded.static <T> TassertTimeout(java.time.Duration timeout, ThrowingSupplier<T> supplier, java.lang.String message)Assert that execution of the suppliedsuppliercompletes before the giventimeoutis exceeded.static <T> TassertTimeout(java.time.Duration timeout, ThrowingSupplier<T> supplier, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that execution of the suppliedsuppliercompletes before the giventimeoutis exceeded.static voidassertTimeoutPreemptively(java.time.Duration timeout, Executable executable)Assert that execution of the suppliedexecutablecompletes before the giventimeoutis exceeded.static voidassertTimeoutPreemptively(java.time.Duration timeout, Executable executable, java.lang.String message)Assert that execution of the suppliedexecutablecompletes before the giventimeoutis exceeded.static voidassertTimeoutPreemptively(java.time.Duration timeout, Executable executable, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that execution of the suppliedexecutablecompletes before the giventimeoutis exceeded.static <T> TassertTimeoutPreemptively(java.time.Duration timeout, ThrowingSupplier<T> supplier)Assert that execution of the suppliedsuppliercompletes before the giventimeoutis exceeded.static <T> TassertTimeoutPreemptively(java.time.Duration timeout, ThrowingSupplier<T> supplier, java.lang.String message)Assert that execution of the suppliedsuppliercompletes before the giventimeoutis exceeded.static <T> TassertTimeoutPreemptively(java.time.Duration timeout, ThrowingSupplier<T> supplier, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that execution of the suppliedsuppliercompletes before the giventimeoutis exceeded.static voidassertTrue(boolean condition)Assert that the suppliedconditionistrue.static voidassertTrue(boolean condition, java.lang.String message)Assert that the suppliedconditionistrue.static voidassertTrue(boolean condition, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that the suppliedconditionistrue.static voidassertTrue(java.util.function.BooleanSupplier booleanSupplier)Assert that the boolean condition supplied bybooleanSupplieristrue.static voidassertTrue(java.util.function.BooleanSupplier booleanSupplier, java.lang.String message)Assert that the boolean condition supplied bybooleanSupplieristrue.static voidassertTrue(java.util.function.BooleanSupplier booleanSupplier, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that the boolean condition supplied bybooleanSupplieristrue.static <V> Vfail()Fail the test without a failure message.static <V> Vfail(java.lang.String message)Fail the test with the given failuremessage.static <V> Vfail(java.lang.String message, java.lang.Throwable cause)Fail the test with the given failuremessageas well as the underlyingcause.static <V> Vfail(java.lang.Throwable cause)Fail the test with the given underlyingcause.static <V> Vfail(java.util.function.Supplier<java.lang.String> messageSupplier)Fail the test with the failure message retrieved from the givenmessageSupplier.
-
-
-
Method Detail
-
fail
public static <V> V fail()
Fail the test without a failure message.Although failing with an explicit failure message is recommended, this method may be useful when maintaining legacy code.
See Javadoc for
fail(String, Throwable)for an explanation of this method's generic return typeV.
-
fail
public static <V> V fail(java.lang.String message)
Fail the test with the given failuremessage.See Javadoc for
fail(String, Throwable)for an explanation of this method's generic return typeV.
-
fail
public static <V> V fail(java.lang.String message, java.lang.Throwable cause)Fail the test with the given failuremessageas well as the underlyingcause.The generic return type
Vallows this method to be used directly as a single-statement lambda expression, thereby avoiding the need to implement a code block with an explicit return value. Since this method throws anAssertionFailedErrorbefore its return statement, this method never actually returns a value to its caller. The following example demonstrates how this may be used in practice.Stream.of().map(entry -> fail("should not be called"));
-
fail
public static <V> V fail(java.lang.Throwable cause)
Fail the test with the given underlyingcause.See Javadoc for
fail(String, Throwable)for an explanation of this method's generic return typeV.
-
fail
public static <V> V fail(java.util.function.Supplier<java.lang.String> messageSupplier)
Fail the test with the failure message retrieved from the givenmessageSupplier.See Javadoc for
fail(String, Throwable)for an explanation of this method's generic return typeV.
-
assertTrue
public static void assertTrue(boolean condition)
Assert that the suppliedconditionistrue.
-
assertTrue
public static void assertTrue(boolean condition, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that the suppliedconditionistrue.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertTrue
public static void assertTrue(java.util.function.BooleanSupplier booleanSupplier)
Assert that the boolean condition supplied bybooleanSupplieristrue.
-
assertTrue
public static void assertTrue(java.util.function.BooleanSupplier booleanSupplier, java.lang.String message)Assert that the boolean condition supplied bybooleanSupplieristrue.Fails with the supplied failure
message.
-
assertTrue
public static void assertTrue(boolean condition, java.lang.String message)Assert that the suppliedconditionistrue.Fails with the supplied failure
message.
-
assertTrue
public static void assertTrue(java.util.function.BooleanSupplier booleanSupplier, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that the boolean condition supplied bybooleanSupplieristrue.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertFalse
public static void assertFalse(boolean condition)
Assert that the suppliedconditionisfalse.
-
assertFalse
public static void assertFalse(boolean condition, java.lang.String message)Assert that the suppliedconditionisfalse.Fails with the supplied failure
message.
-
assertFalse
public static void assertFalse(boolean condition, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that the suppliedconditionisfalse.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertFalse
public static void assertFalse(java.util.function.BooleanSupplier booleanSupplier)
Assert that the boolean condition supplied bybooleanSupplierisfalse.
-
assertFalse
public static void assertFalse(java.util.function.BooleanSupplier booleanSupplier, java.lang.String message)Assert that the boolean condition supplied bybooleanSupplierisfalse.Fails with the supplied failure
message.
-
assertFalse
public static void assertFalse(java.util.function.BooleanSupplier booleanSupplier, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that the boolean condition supplied bybooleanSupplierisfalse.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertNull
public static void assertNull(java.lang.Object actual)
Assert thatactualisnull.
-
assertNull
public static void assertNull(java.lang.Object actual, java.lang.String message)Assert thatactualisnull.Fails with the supplied failure
message.
-
assertNull
public static void assertNull(java.lang.Object actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatactualisnull.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertNotNull
public static void assertNotNull(java.lang.Object actual)
Assert thatactualis notnull.
-
assertNotNull
public static void assertNotNull(java.lang.Object actual, java.lang.String message)Assert thatactualis notnull.Fails with the supplied failure
message.
-
assertNotNull
public static void assertNotNull(java.lang.Object actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatactualis notnull.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
public static void assertEquals(short expected, short actual)Assert thatexpectedandactualare equal.
-
assertEquals
public static void assertEquals(short expected, java.lang.Short actual)Assert thatexpectedandactualare equal.
-
assertEquals
public static void assertEquals(java.lang.Short expected, short actual)Assert thatexpectedandactualare equal.
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Short expected, java.lang.Short actual)Assert thatexpectedandactualare equal.- Since:
- 5.4
-
assertEquals
public static void assertEquals(short expected, short actual, java.lang.String message)Assert thatexpectedandactualare equal.Fails with the supplied failure
message.
-
assertEquals
public static void assertEquals(short expected, java.lang.Short actual, java.lang.String message)Assert thatexpectedandactualare equal.Fails with the supplied failure
message.
-
assertEquals
public static void assertEquals(java.lang.Short expected, short actual, java.lang.String message)Assert thatexpectedandactualare equal.Fails with the supplied failure
message.
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Short expected, java.lang.Short actual, java.lang.String message)Assert thatexpectedandactualare equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertEquals
public static void assertEquals(short expected, short actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
public static void assertEquals(short expected, java.lang.Short actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
public static void assertEquals(java.lang.Short expected, short actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Short expected, java.lang.Short actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertEquals
public static void assertEquals(byte expected, byte actual)Assert thatexpectedandactualare equal.
-
assertEquals
public static void assertEquals(byte expected, java.lang.Byte actual)Assert thatexpectedandactualare equal.
-
assertEquals
public static void assertEquals(java.lang.Byte expected, byte actual)Assert thatexpectedandactualare equal.
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Byte expected, java.lang.Byte actual)Assert thatexpectedandactualare equal.- Since:
- 5.4
-
assertEquals
public static void assertEquals(byte expected, byte actual, java.lang.String message)Assert thatexpectedandactualare equal.Fails with the supplied failure
message.
-
assertEquals
public static void assertEquals(byte expected, java.lang.Byte actual, java.lang.String message)Assert thatexpectedandactualare equal.Fails with the supplied failure
message.
-
assertEquals
public static void assertEquals(java.lang.Byte expected, byte actual, java.lang.String message)Assert thatexpectedandactualare equal.Fails with the supplied failure
message.
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Byte expected, java.lang.Byte actual, java.lang.String message)Assert thatexpectedandactualare equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertEquals
public static void assertEquals(byte expected, byte actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
public static void assertEquals(byte expected, java.lang.Byte actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
public static void assertEquals(java.lang.Byte expected, byte actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Byte expected, java.lang.Byte actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertEquals
public static void assertEquals(int expected, int actual)Assert thatexpectedandactualare equal.
-
assertEquals
public static void assertEquals(int expected, java.lang.Integer actual)Assert thatexpectedandactualare equal.
-
assertEquals
public static void assertEquals(java.lang.Integer expected, int actual)Assert thatexpectedandactualare equal.
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Integer expected, java.lang.Integer actual)Assert thatexpectedandactualare equal.- Since:
- 5.4
-
assertEquals
public static void assertEquals(int expected, int actual, java.lang.String message)Assert thatexpectedandactualare equal.Fails with the supplied failure
message.
-
assertEquals
public static void assertEquals(int expected, java.lang.Integer actual, java.lang.String message)Assert thatexpectedandactualare equal.Fails with the supplied failure
message.
-
assertEquals
public static void assertEquals(java.lang.Integer expected, int actual, java.lang.String message)Assert thatexpectedandactualare equal.Fails with the supplied failure
message.
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Integer expected, java.lang.Integer actual, java.lang.String message)Assert thatexpectedandactualare equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertEquals
public static void assertEquals(int expected, int actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
public static void assertEquals(int expected, java.lang.Integer actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
public static void assertEquals(java.lang.Integer expected, int actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Integer expected, java.lang.Integer actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertEquals
public static void assertEquals(long expected, long actual)Assert thatexpectedandactualare equal.
-
assertEquals
public static void assertEquals(long expected, java.lang.Long actual)Assert thatexpectedandactualare equal.
-
assertEquals
public static void assertEquals(java.lang.Long expected, long actual)Assert thatexpectedandactualare equal.
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Long expected, java.lang.Long actual)Assert thatexpectedandactualare equal.- Since:
- 5.4
-
assertEquals
public static void assertEquals(long expected, long actual, java.lang.String message)Assert thatexpectedandactualare equal.Fails with the supplied failure
message.
-
assertEquals
public static void assertEquals(long expected, java.lang.Long actual, java.lang.String message)Assert thatexpectedandactualare equal.Fails with the supplied failure
message.
-
assertEquals
public static void assertEquals(java.lang.Long expected, long actual, java.lang.String message)Assert thatexpectedandactualare equal.Fails with the supplied failure
message.
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Long expected, java.lang.Long actual, java.lang.String message)Assert thatexpectedandactualare equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertEquals
public static void assertEquals(long expected, long actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
public static void assertEquals(long expected, java.lang.Long actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
public static void assertEquals(java.lang.Long expected, long actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Long expected, java.lang.Long actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertEquals
public static void assertEquals(float expected, float actual)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).
-
assertEquals
public static void assertEquals(float expected, java.lang.Float actual)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).
-
assertEquals
public static void assertEquals(java.lang.Float expected, float actual)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Float expected, java.lang.Float actual)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).- Since:
- 5.4
-
assertEquals
public static void assertEquals(float expected, float actual, java.lang.String message)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).Fails with the supplied failure
message.
-
assertEquals
public static void assertEquals(float expected, java.lang.Float actual, java.lang.String message)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).Fails with the supplied failure
message.
-
assertEquals
public static void assertEquals(java.lang.Float expected, float actual, java.lang.String message)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).Fails with the supplied failure
message.
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Float expected, java.lang.Float actual, java.lang.String message)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).Fails with the supplied failure
message.- Since:
- 5.4
-
assertEquals
public static void assertEquals(float expected, float actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
public static void assertEquals(float expected, java.lang.Float actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
public static void assertEquals(java.lang.Float expected, float actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Float expected, java.lang.Float actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertEquals
public static void assertEquals(float expected, float actual, float delta)Assert thatexpectedandactualare equal within the given non-negativedelta.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).
-
assertEquals
public static void assertEquals(float expected, float actual, float delta, java.lang.String message)Assert thatexpectedandactualare equal within the given non-negativedelta.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).Fails with the supplied failure
message.
-
assertEquals
public static void assertEquals(float expected, float actual, float delta, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal within the given non-negativedelta.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
public static void assertEquals(double expected, double actual)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).
-
assertEquals
public static void assertEquals(double expected, java.lang.Double actual)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).
-
assertEquals
public static void assertEquals(java.lang.Double expected, double actual)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Double expected, java.lang.Double actual)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).- Since:
- 5.4
-
assertEquals
public static void assertEquals(double expected, double actual, java.lang.String message)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).Fails with the supplied failure
message.
-
assertEquals
public static void assertEquals(double expected, java.lang.Double actual, java.lang.String message)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).Fails with the supplied failure
message.
-
assertEquals
public static void assertEquals(java.lang.Double expected, double actual, java.lang.String message)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).Fails with the supplied failure
message.
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Double expected, java.lang.Double actual, java.lang.String message)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).Fails with the supplied failure
message.- Since:
- 5.4
-
assertEquals
public static void assertEquals(double expected, double actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
public static void assertEquals(double expected, java.lang.Double actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
public static void assertEquals(java.lang.Double expected, double actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Double expected, java.lang.Double actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertEquals
public static void assertEquals(double expected, double actual, double delta)Assert thatexpectedandactualare equal within the given non-negativedelta.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).
-
assertEquals
public static void assertEquals(double expected, double actual, double delta, java.lang.String message)Assert thatexpectedandactualare equal within the given non-negativedelta.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).Fails with the supplied failure
message.
-
assertEquals
public static void assertEquals(double expected, double actual, double delta, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal within the given non-negativedelta.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
public static void assertEquals(char expected, char actual)Assert thatexpectedandactualare equal.
-
assertEquals
public static void assertEquals(char expected, java.lang.Character actual)Assert thatexpectedandactualare equal.
-
assertEquals
public static void assertEquals(java.lang.Character expected, char actual)Assert thatexpectedandactualare equal.
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Character expected, java.lang.Character actual)Assert thatexpectedandactualare equal.- Since:
- 5.4
-
assertEquals
public static void assertEquals(char expected, char actual, java.lang.String message)Assert thatexpectedandactualare equal.Fails with the supplied failure
message.
-
assertEquals
public static void assertEquals(char expected, java.lang.Character actual, java.lang.String message)Assert thatexpectedandactualare equal.Fails with the supplied failure
message.
-
assertEquals
public static void assertEquals(java.lang.Character expected, char actual, java.lang.String message)Assert thatexpectedandactualare equal.Fails with the supplied failure
message.
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Character expected, java.lang.Character actual, java.lang.String message)Assert thatexpectedandactualare equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertEquals
public static void assertEquals(char expected, char actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
public static void assertEquals(char expected, java.lang.Character actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
public static void assertEquals(java.lang.Character expected, char actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertEquals
@API(status=STABLE, since="5.4") public static void assertEquals(java.lang.Character expected, java.lang.Character actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertEquals
public static void assertEquals(java.lang.Object expected, java.lang.Object actual)Assert thatexpectedandactualare equal.If both are
null, they are considered equal.- See Also:
Object.equals(Object)
-
assertEquals
public static void assertEquals(java.lang.Object expected, java.lang.Object actual, java.lang.String message)Assert thatexpectedandactualare equal.If both are
null, they are considered equal.Fails with the supplied failure
message.- See Also:
Object.equals(Object)
-
assertEquals
public static void assertEquals(java.lang.Object expected, java.lang.Object actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare equal.If both are
null, they are considered equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- See Also:
Object.equals(Object)
-
assertArrayEquals
public static void assertArrayEquals(boolean[] expected, boolean[] actual)Assert thatexpectedandactualboolean arrays are equal.If both are
null, they are considered equal.
-
assertArrayEquals
public static void assertArrayEquals(boolean[] expected, boolean[] actual, java.lang.String message)Assert thatexpectedandactualboolean arrays are equal.If both are
null, they are considered equal.Fails with the supplied failure
message.
-
assertArrayEquals
public static void assertArrayEquals(boolean[] expected, boolean[] actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualboolean arrays are equal.If both are
null, they are considered equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertArrayEquals
public static void assertArrayEquals(char[] expected, char[] actual)Assert thatexpectedandactualchar arrays are equal.If both are
null, they are considered equal.
-
assertArrayEquals
public static void assertArrayEquals(char[] expected, char[] actual, java.lang.String message)Assert thatexpectedandactualchar arrays are equal.If both are
null, they are considered equal.Fails with the supplied failure
message.
-
assertArrayEquals
public static void assertArrayEquals(char[] expected, char[] actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualchar arrays are equal.If both are
null, they are considered equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertArrayEquals
public static void assertArrayEquals(byte[] expected, byte[] actual)Assert thatexpectedandactualbyte arrays are equal.If both are
null, they are considered equal.
-
assertArrayEquals
public static void assertArrayEquals(byte[] expected, byte[] actual, java.lang.String message)Assert thatexpectedandactualbyte arrays are equal.If both are
null, they are considered equal.Fails with the supplied failure
message.
-
assertArrayEquals
public static void assertArrayEquals(byte[] expected, byte[] actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualbyte arrays are equal.If both are
null, they are considered equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertArrayEquals
public static void assertArrayEquals(short[] expected, short[] actual)Assert thatexpectedandactualshort arrays are equal.If both are
null, they are considered equal.
-
assertArrayEquals
public static void assertArrayEquals(short[] expected, short[] actual, java.lang.String message)Assert thatexpectedandactualshort arrays are equal.If both are
null, they are considered equal.Fails with the supplied failure
message.
-
assertArrayEquals
public static void assertArrayEquals(short[] expected, short[] actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualshort arrays are equal.If both are
null, they are considered equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertArrayEquals
public static void assertArrayEquals(int[] expected, int[] actual)Assert thatexpectedandactualint arrays are equal.If both are
null, they are considered equal.
-
assertArrayEquals
public static void assertArrayEquals(int[] expected, int[] actual, java.lang.String message)Assert thatexpectedandactualint arrays are equal.If both are
null, they are considered equal.Fails with the supplied failure
message.
-
assertArrayEquals
public static void assertArrayEquals(int[] expected, int[] actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualint arrays are equal.If both are
null, they are considered equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertArrayEquals
public static void assertArrayEquals(long[] expected, long[] actual)Assert thatexpectedandactuallong arrays are equal.If both are
null, they are considered equal.
-
assertArrayEquals
public static void assertArrayEquals(long[] expected, long[] actual, java.lang.String message)Assert thatexpectedandactuallong arrays are equal.If both are
null, they are considered equal.Fails with the supplied failure
message.
-
assertArrayEquals
public static void assertArrayEquals(long[] expected, long[] actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactuallong arrays are equal.If both are
null, they are considered equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertArrayEquals
public static void assertArrayEquals(float[] expected, float[] actual)Assert thatexpectedandactualfloat arrays are equal.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).
-
assertArrayEquals
public static void assertArrayEquals(float[] expected, float[] actual, java.lang.String message)Assert thatexpectedandactualfloat arrays are equal.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).Fails with the supplied failure
message.
-
assertArrayEquals
public static void assertArrayEquals(float[] expected, float[] actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualfloat arrays are equal.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertArrayEquals
public static void assertArrayEquals(float[] expected, float[] actual, float delta)Assert thatexpectedandactualfloat arrays are equal within the given non-negativedelta.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).
-
assertArrayEquals
public static void assertArrayEquals(float[] expected, float[] actual, float delta, java.lang.String message)Assert thatexpectedandactualfloat arrays are equal within the given non-negativedelta.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).Fails with the supplied failure
message.
-
assertArrayEquals
public static void assertArrayEquals(float[] expected, float[] actual, float delta, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualfloat arrays are equal within the given non-negativedelta.Equality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertArrayEquals
public static void assertArrayEquals(double[] expected, double[] actual)Assert thatexpectedandactualdouble arrays are equal.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).
-
assertArrayEquals
public static void assertArrayEquals(double[] expected, double[] actual, java.lang.String message)Assert thatexpectedandactualdouble arrays are equal.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).Fails with the supplied failure
message.
-
assertArrayEquals
public static void assertArrayEquals(double[] expected, double[] actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualdouble arrays are equal.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertArrayEquals
public static void assertArrayEquals(double[] expected, double[] actual, double delta)Assert thatexpectedandactualdouble arrays are equal within the given non-negativedelta.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).
-
assertArrayEquals
public static void assertArrayEquals(double[] expected, double[] actual, double delta, java.lang.String message)Assert thatexpectedandactualdouble arrays are equal within the given non-negativedelta.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).Fails with the supplied failure
message.
-
assertArrayEquals
public static void assertArrayEquals(double[] expected, double[] actual, double delta, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualdouble arrays are equal within the given non-negativedelta.Equality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertArrayEquals
public static void assertArrayEquals(java.lang.Object[] expected, java.lang.Object[] actual)Assert thatexpectedandactualobject arrays are deeply equal.If both are
null, they are considered equal.Nested float arrays are checked as in
assertEquals(float, float).Nested double arrays are checked as in
assertEquals(double, double).- See Also:
Objects.equals(Object, Object),Arrays.deepEquals(Object[], Object[])
-
assertArrayEquals
public static void assertArrayEquals(java.lang.Object[] expected, java.lang.Object[] actual, java.lang.String message)Assert thatexpectedandactualobject arrays are deeply equal.If both are
null, they are considered equal.Nested float arrays are checked as in
assertEquals(float, float).Nested double arrays are checked as in
assertEquals(double, double).Fails with the supplied failure
message.- See Also:
Objects.equals(Object, Object),Arrays.deepEquals(Object[], Object[])
-
assertArrayEquals
public static void assertArrayEquals(java.lang.Object[] expected, java.lang.Object[] actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualobject arrays are deeply equal.If both are
null, they are considered equal.Nested float arrays are checked as in
assertEquals(float, float).Nested double arrays are checked as in
assertEquals(double, double).If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- See Also:
Objects.equals(Object, Object),Arrays.deepEquals(Object[], Object[])
-
assertIterableEquals
public static void assertIterableEquals(java.lang.Iterable<?> expected, java.lang.Iterable<?> actual)Assert thatexpectedandactualiterables are deeply equal.Similarly to the check for deep equality in
assertArrayEquals(Object[], Object[]), if two iterables are encountered (includingexpectedandactual) then their iterators must return equal elements in the same order as each other. Note: this means that the iterables do not need to be of the same type. Example:import static java.util.Arrays.asList; . . . Iterable<Integer> i0 = new ArrayList<>(asList(1, 2, 3)); Iterable<Integer> i1 = new LinkedList<>(asList(1, 2, 3)); assertIterableEquals(i0, i1); // PassesIf both
expectedandactualarenull, they are considered equal.- See Also:
Objects.equals(Object, Object),Arrays.deepEquals(Object[], Object[]),assertArrayEquals(Object[], Object[])
-
assertIterableEquals
public static void assertIterableEquals(java.lang.Iterable<?> expected, java.lang.Iterable<?> actual, java.lang.String message)Assert thatexpectedandactualiterables are deeply equal.Similarly to the check for deep equality in
assertArrayEquals(Object[], Object[], String), if two iterables are encountered (includingexpectedandactual) then their iterators must return equal elements in the same order as each other. Note: this means that the iterables do not need to be of the same type. Example:import static java.util.Arrays.asList; . . . Iterable<Integer> i0 = new ArrayList<>(asList(1, 2, 3)); Iterable<Integer> i1 = new LinkedList<>(asList(1, 2, 3)); assertIterableEquals(i0, i1); // PassesIf both
expectedandactualarenull, they are considered equal.Fails with the supplied failure
message.- See Also:
Objects.equals(Object, Object),Arrays.deepEquals(Object[], Object[]),assertArrayEquals(Object[], Object[], String)
-
assertIterableEquals
public static void assertIterableEquals(java.lang.Iterable<?> expected, java.lang.Iterable<?> actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualiterables are deeply equal.Similarly to the check for deep equality in
assertArrayEquals(Object[], Object[], Supplier), if two iterables are encountered (includingexpectedandactual) then their iterators must return equal elements in the same order as each other. Note: this means that the iterables do not need to be of the same type. Example:import static java.util.Arrays.asList; . . . Iterable<Integer> i0 = new ArrayList<>(asList(1, 2, 3)); Iterable<Integer> i1 = new LinkedList<>(asList(1, 2, 3)); assertIterableEquals(i0, i1); // PassesIf both
expectedandactualarenull, they are considered equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- See Also:
Objects.equals(Object, Object),Arrays.deepEquals(Object[], Object[]),assertArrayEquals(Object[], Object[], Supplier)
-
assertLinesMatch
public static void assertLinesMatch(java.util.List<java.lang.String> expectedLines, java.util.List<java.lang.String> actualLines)Assert thatexpectedlist of Strings matchesactuallist.This method differs from other assertions that effectively only check
String.equals(Object), in that it uses the following staged matching algorithm:For each pair of expected and actual lines do
- check if
expected.equals(actual)- if yes, continue with next pair - otherwise treat
expectedas a regular expression and check viaString.matches(String)- if yes, continue with next pair - otherwise check if
expectedline is a fast-forward marker, if yes apply fast-forward actual lines accordingly (see below) and goto 1.
A valid fast-forward marker is an expected line that starts and ends with the literal
>>and contains at least 4 characters. Examples:>>>>>> stacktrace >>>> single line, non Integer.parse()-able comment >>
Skip arbitrary number of actual lines, until first matching subsequent expected line is found. Any character between the fast-forward literals are discarded.">> 21 >>"
Skip strictly 21 lines. If they can't be skipped for any reason, an assertion error is raised.
Here is an example showing all three kinds of expected line formats:
ls -la / total [\d]+ drwxr-xr-x 0 root root 512 Jan 1 1970 . drwxr-xr-x 0 root root 512 Jan 1 1970 .. drwxr-xr-x 0 root root 512 Apr 5 07:45 bin >> 4 >> -rwxr-xr-x 1 root root [\d]+ Jan 1 1970 init >> M A N Y M O R E E N T R I E S >> drwxr-xr-x 0 root root 512 Sep 22 2017 varFails with a generated failure message describing the difference.
- check if
-
assertLinesMatch
public static void assertLinesMatch(java.util.List<java.lang.String> expectedLines, java.util.List<java.lang.String> actualLines, java.lang.String message)Assert thatexpectedlist of Strings matchesactuallist.Find a detailed description of the matching algorithm in
assertLinesMatch(List, List).Fails with the supplied failure
messageand the generated message.- See Also:
assertLinesMatch(List, List)
-
assertLinesMatch
public static void assertLinesMatch(java.util.List<java.lang.String> expectedLines, java.util.List<java.lang.String> actualLines, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedlist of Strings matchesactuallist.Find a detailed description of the matching algorithm in
assertLinesMatch(List, List).If necessary, a custom failure message will be retrieved lazily from the supplied
messageSupplier. Fails with the custom failure message prepended to a generated failure message describing the difference.- See Also:
assertLinesMatch(List, List)
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(byte unexpected, byte actual)Assert thatexpectedandactualare not equal.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(byte unexpected, java.lang.Byte actual)Assert thatexpectedandactualare not equal.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Byte unexpected, byte actual)Assert thatexpectedandactualare not equal.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Byte unexpected, java.lang.Byte actual)Assert thatexpectedandactualare not equal.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(byte unexpected, byte actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(byte unexpected, java.lang.Byte actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Byte unexpected, byte actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Byte unexpected, java.lang.Byte actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(byte unexpected, byte actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(byte unexpected, java.lang.Byte actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Byte unexpected, byte actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Byte unexpected, java.lang.Byte actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(short unexpected, short actual)Assert thatexpectedandactualare not equal.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(short unexpected, java.lang.Short actual)Assert thatexpectedandactualare not equal.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Short unexpected, short actual)Assert thatexpectedandactualare not equal.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Short unexpected, java.lang.Short actual)Assert thatexpectedandactualare not equal.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(short unexpected, short actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(short unexpected, java.lang.Short actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Short unexpected, short actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Short unexpected, java.lang.Short actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(short unexpected, short actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(short unexpected, java.lang.Short actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Short unexpected, short actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Short unexpected, java.lang.Short actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(int unexpected, int actual)Assert thatexpectedandactualare not equal.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(int unexpected, java.lang.Integer actual)Assert thatexpectedandactualare not equal.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Integer unexpected, int actual)Assert thatexpectedandactualare not equal.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Integer unexpected, java.lang.Integer actual)Assert thatexpectedandactualare not equal.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(int unexpected, int actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(int unexpected, java.lang.Integer actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Integer unexpected, int actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Integer unexpected, java.lang.Integer actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(int unexpected, int actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(int unexpected, java.lang.Integer actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Integer unexpected, int actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Integer unexpected, java.lang.Integer actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(long unexpected, long actual)Assert thatexpectedandactualare not equal.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(long unexpected, java.lang.Long actual)Assert thatexpectedandactualare not equal.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Long unexpected, long actual)Assert thatexpectedandactualare not equal.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Long unexpected, java.lang.Long actual)Assert thatexpectedandactualare not equal.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(long unexpected, long actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(long unexpected, java.lang.Long actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Long unexpected, long actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Long unexpected, java.lang.Long actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(long unexpected, long actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(long unexpected, java.lang.Long actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Long unexpected, long actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Long unexpected, java.lang.Long actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(float unexpected, float actual)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(float unexpected, java.lang.Float actual)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Float unexpected, float actual)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Float unexpected, java.lang.Float actual)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(float unexpected, float actual, java.lang.String message)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(float unexpected, java.lang.Float actual, java.lang.String message)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Float unexpected, float actual, java.lang.String message)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Float unexpected, java.lang.Float actual, java.lang.String message)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(float unexpected, float actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(float unexpected, java.lang.Float actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Float unexpected, float actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Float unexpected, java.lang.Float actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(float unexpected, float actual, float delta)Assert thatexpectedandactualare not equal within the givendelta.Inequality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(float unexpected, float actual, float delta, java.lang.String message)Assert thatexpectedandactualare not equal within the givendelta.Inequality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(float unexpected, float actual, float delta, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal within the givendelta.Inequality imposed by this method is consistent with
Float.equals(Object)andFloat.compare(float, float).- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(double unexpected, double actual)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(double unexpected, java.lang.Double actual)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Double unexpected, double actual)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Double unexpected, java.lang.Double actual)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(double unexpected, double actual, java.lang.String message)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(double unexpected, java.lang.Double actual, java.lang.String message)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Double unexpected, double actual, java.lang.String message)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Double unexpected, java.lang.Double actual, java.lang.String message)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(double unexpected, double actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(double unexpected, java.lang.Double actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Double unexpected, double actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Double unexpected, java.lang.Double actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.Inequality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(double unexpected, double actual, double delta)Assert thatexpectedandactualare not equal within the givendelta.Inequality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(double unexpected, double actual, double delta, java.lang.String message)Assert thatexpectedandactualare not equal within the givendelta.Inequality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(double unexpected, double actual, double delta, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal within the givendelta.Inequality imposed by this method is consistent with
Double.equals(Object)andDouble.compare(double, double).- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(char unexpected, char actual)Assert thatexpectedandactualare not equal.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(char unexpected, java.lang.Character actual)Assert thatexpectedandactualare not equal.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Character unexpected, char actual)Assert thatexpectedandactualare not equal.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Character unexpected, java.lang.Character actual)Assert thatexpectedandactualare not equal.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(char unexpected, char actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(char unexpected, java.lang.Character actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Character unexpected, char actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Character unexpected, java.lang.Character actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails with the supplied failure
message.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(char unexpected, char actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(char unexpected, java.lang.Character actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Character unexpected, char actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertNotEquals
@API(status=STABLE, since="5.4") public static void assertNotEquals(java.lang.Character unexpected, java.lang.Character actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.4
-
assertNotEquals
public static void assertNotEquals(java.lang.Object unexpected, java.lang.Object actual)Assert thatexpectedandactualare not equal.Fails if both are
null.- See Also:
Object.equals(Object)
-
assertNotEquals
public static void assertNotEquals(java.lang.Object unexpected, java.lang.Object actual, java.lang.String message)Assert thatexpectedandactualare not equal.Fails if both are
null.Fails with the supplied failure
message.- See Also:
Object.equals(Object)
-
assertNotEquals
public static void assertNotEquals(java.lang.Object unexpected, java.lang.Object actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualare not equal.Fails if both are
null.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- See Also:
Object.equals(Object)
-
assertSame
public static void assertSame(java.lang.Object expected, java.lang.Object actual)Assert thatexpectedandactualrefer to the same object.
-
assertSame
public static void assertSame(java.lang.Object expected, java.lang.Object actual, java.lang.String message)Assert thatexpectedandactualrefer to the same object.Fails with the supplied failure
message.
-
assertSame
public static void assertSame(java.lang.Object expected, java.lang.Object actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualrefer to the same object.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertNotSame
public static void assertNotSame(java.lang.Object unexpected, java.lang.Object actual)Assert thatexpectedandactualdo not refer to the same object.
-
assertNotSame
public static void assertNotSame(java.lang.Object unexpected, java.lang.Object actual, java.lang.String message)Assert thatexpectedandactualdo not refer to the same object.Fails with the supplied failure
message.
-
assertNotSame
public static void assertNotSame(java.lang.Object unexpected, java.lang.Object actual, java.util.function.Supplier<java.lang.String> messageSupplier)Assert thatexpectedandactualdo not refer to the same object.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertAll
public static void assertAll(Executable... executables) throws org.opentest4j.MultipleFailuresError
Assert that all suppliedexecutablesdo not throw exceptions.See Javadoc for
assertAll(String, Stream)for an explanation of this method's exception handling semantics.- Throws:
org.opentest4j.MultipleFailuresError- See Also:
assertAll(String, Executable...),assertAll(Collection),assertAll(String, Collection),assertAll(Stream),assertAll(String, Stream)
-
assertAll
public static void assertAll(java.lang.String heading, Executable... executables) throws org.opentest4j.MultipleFailuresErrorAssert that all suppliedexecutablesdo not throw exceptions.See Javadoc for
assertAll(String, Stream)for an explanation of this method's exception handling semantics.- Throws:
org.opentest4j.MultipleFailuresError- See Also:
assertAll(Executable...),assertAll(Collection),assertAll(Stream),assertAll(String, Collection),assertAll(String, Stream)
-
assertAll
public static void assertAll(java.util.Collection<Executable> executables) throws org.opentest4j.MultipleFailuresError
Assert that all suppliedexecutablesdo not throw exceptions.See Javadoc for
assertAll(String, Stream)for an explanation of this method's exception handling semantics.- Throws:
org.opentest4j.MultipleFailuresError- See Also:
assertAll(Executable...),assertAll(String, Executable...),assertAll(String, Collection),assertAll(Stream),assertAll(String, Stream)
-
assertAll
public static void assertAll(java.lang.String heading, java.util.Collection<Executable> executables) throws org.opentest4j.MultipleFailuresErrorAssert that all suppliedexecutablesdo not throw exceptions.See Javadoc for
assertAll(String, Stream)for an explanation of this method's exception handling semantics.- Throws:
org.opentest4j.MultipleFailuresError- See Also:
assertAll(Executable...),assertAll(String, Executable...),assertAll(Collection),assertAll(Stream),assertAll(String, Stream)
-
assertAll
public static void assertAll(java.util.stream.Stream<Executable> executables) throws org.opentest4j.MultipleFailuresError
Assert that all suppliedexecutablesdo not throw exceptions.See Javadoc for
assertAll(String, Stream)for an explanation of this method's exception handling semantics.- Throws:
org.opentest4j.MultipleFailuresError- See Also:
assertAll(Executable...),assertAll(String, Executable...),assertAll(Collection),assertAll(String, Collection),assertAll(String, Stream)
-
assertAll
public static void assertAll(java.lang.String heading, java.util.stream.Stream<Executable> executables) throws org.opentest4j.MultipleFailuresErrorAssert that all suppliedexecutablesdo not throw exceptions.If any supplied
Executablethrows an exception (i.e., aThrowableor any subclass thereof), all remainingexecutableswill still be executed, and all exceptions will be aggregated and reported in aMultipleFailuresError. In addition, all aggregated exceptions will be added as suppressed exceptions to theMultipleFailuresError. However, if anexecutablethrows a blacklisted exception — for example, anOutOfMemoryError— execution will halt immediately, and the blacklisted exception will be rethrown as is but masked as an unchecked exception.The supplied
headingwill be included in the message string for theMultipleFailuresError.- Throws:
org.opentest4j.MultipleFailuresError- See Also:
assertAll(Executable...),assertAll(String, Executable...),assertAll(Collection),assertAll(String, Collection),assertAll(Stream)
-
assertThrows
public static <T extends java.lang.Throwable> T assertThrows(java.lang.Class<T> expectedType, Executable executable)Assert that execution of the suppliedexecutablethrows an exception of theexpectedTypeand return the exception.If no exception is thrown, or if an exception of a different type is thrown, this method will fail.
If you do not want to perform additional checks on the exception instance, simply ignore the return value.
-
assertThrows
public static <T extends java.lang.Throwable> T assertThrows(java.lang.Class<T> expectedType, Executable executable, java.lang.String message)Assert that execution of the suppliedexecutablethrows an exception of theexpectedTypeand return the exception.If no exception is thrown, or if an exception of a different type is thrown, this method will fail.
If you do not want to perform additional checks on the exception instance, simply ignore the return value.
Fails with the supplied failure
message.
-
assertThrows
public static <T extends java.lang.Throwable> T assertThrows(java.lang.Class<T> expectedType, Executable executable, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that execution of the suppliedexecutablethrows an exception of theexpectedTypeand return the exception.If no exception is thrown, or if an exception of a different type is thrown, this method will fail.
If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.If you do not want to perform additional checks on the exception instance, simply ignore the return value.
-
assertDoesNotThrow
@API(status=STABLE, since="5.2") public static void assertDoesNotThrow(Executable executable)Assert that execution of the suppliedexecutabledoes not throw any kind of exception.Usage Note
Although any exception thrown from a test method will cause the test to fail, there are certain use cases where it can be beneficial to explicitly assert that an exception is not thrown for a given code block within a test method.
- Since:
- 5.2
-
assertDoesNotThrow
@API(status=STABLE, since="5.2") public static void assertDoesNotThrow(Executable executable, java.lang.String message)Assert that execution of the suppliedexecutabledoes not throw any kind of exception.Usage Note
Although any exception thrown from a test method will cause the test to fail, there are certain use cases where it can be beneficial to explicitly assert that an exception is not thrown for a given code block within a test method.
Fails with the supplied failure
message.- Since:
- 5.2
-
assertDoesNotThrow
@API(status=STABLE, since="5.2") public static void assertDoesNotThrow(Executable executable, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that execution of the suppliedexecutabledoes not throw any kind of exception.Usage Note
Although any exception thrown from a test method will cause the test to fail, there are certain use cases where it can be beneficial to explicitly assert that an exception is not thrown for a given code block within a test method.
If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- Since:
- 5.2
-
assertDoesNotThrow
@API(status=STABLE, since="5.2") public static <T> T assertDoesNotThrow(ThrowingSupplier<T> supplier)Assert that execution of the suppliedsupplierdoes not throw any kind of exception.If the assertion passes, the
supplier's result will be returned.Usage Note
Although any exception thrown from a test method will cause the test to fail, there are certain use cases where it can be beneficial to explicitly assert that an exception is not thrown for a given code block within a test method.
- Since:
- 5.2
-
assertDoesNotThrow
@API(status=STABLE, since="5.2") public static <T> T assertDoesNotThrow(ThrowingSupplier<T> supplier, java.lang.String message)Assert that execution of the suppliedsupplierdoes not throw any kind of exception.If the assertion passes, the
supplier's result will be returned.Fails with the supplied failure
message.Usage Note
Although any exception thrown from a test method will cause the test to fail, there are certain use cases where it can be beneficial to explicitly assert that an exception is not thrown for a given code block within a test method.
- Since:
- 5.2
-
assertDoesNotThrow
@API(status=STABLE, since="5.2") public static <T> T assertDoesNotThrow(ThrowingSupplier<T> supplier, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that execution of the suppliedsupplierdoes not throw any kind of exception.If the assertion passes, the
supplier's result will be returned.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.Usage Note
Although any exception thrown from a test method will cause the test to fail, there are certain use cases where it can be beneficial to explicitly assert that an exception is not thrown for a given code block within a test method.
- Since:
- 5.2
-
assertTimeout
public static void assertTimeout(java.time.Duration timeout, Executable executable)Assert that execution of the suppliedexecutablecompletes before the giventimeoutis exceeded.Note: the
executablewill be executed in the same thread as that of the calling code. Consequently, execution of theexecutablewill not be preemptively aborted if the timeout is exceeded.
-
assertTimeout
public static void assertTimeout(java.time.Duration timeout, Executable executable, java.lang.String message)Assert that execution of the suppliedexecutablecompletes before the giventimeoutis exceeded.Note: the
executablewill be executed in the same thread as that of the calling code. Consequently, execution of theexecutablewill not be preemptively aborted if the timeout is exceeded.Fails with the supplied failure
message.
-
assertTimeout
public static void assertTimeout(java.time.Duration timeout, Executable executable, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that execution of the suppliedexecutablecompletes before the giventimeoutis exceeded.Note: the
executablewill be executed in the same thread as that of the calling code. Consequently, execution of theexecutablewill not be preemptively aborted if the timeout is exceeded.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertTimeout
public static <T> T assertTimeout(java.time.Duration timeout, ThrowingSupplier<T> supplier)Assert that execution of the suppliedsuppliercompletes before the giventimeoutis exceeded.If the assertion passes then the
supplier's result is returned.Note: the
supplierwill be executed in the same thread as that of the calling code. Consequently, execution of thesupplierwill not be preemptively aborted if the timeout is exceeded.
-
assertTimeout
public static <T> T assertTimeout(java.time.Duration timeout, ThrowingSupplier<T> supplier, java.lang.String message)Assert that execution of the suppliedsuppliercompletes before the giventimeoutis exceeded.If the assertion passes then the
supplier's result is returned.Note: the
supplierwill be executed in the same thread as that of the calling code. Consequently, execution of thesupplierwill not be preemptively aborted if the timeout is exceeded.Fails with the supplied failure
message.
-
assertTimeout
public static <T> T assertTimeout(java.time.Duration timeout, ThrowingSupplier<T> supplier, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that execution of the suppliedsuppliercompletes before the giventimeoutis exceeded.If the assertion passes then the
supplier's result is returned.Note: the
supplierwill be executed in the same thread as that of the calling code. Consequently, execution of thesupplierwill not be preemptively aborted if the timeout is exceeded.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.
-
assertTimeoutPreemptively
public static void assertTimeoutPreemptively(java.time.Duration timeout, Executable executable)Assert that execution of the suppliedexecutablecompletes before the giventimeoutis exceeded.Note: the
executablewill be executed in a different thread than that of the calling code. Furthermore, execution of theexecutablewill be preemptively aborted if the timeout is exceeded. See the Preemptive Timeouts section of the class-level Javadoc for a discussion of possible undesirable side effects.- See Also:
assertTimeoutPreemptively(Duration, Executable, String),assertTimeoutPreemptively(Duration, Executable, Supplier),assertTimeoutPreemptively(Duration, ThrowingSupplier),assertTimeoutPreemptively(Duration, ThrowingSupplier, String),assertTimeoutPreemptively(Duration, ThrowingSupplier, Supplier),assertTimeout(Duration, Executable)
-
assertTimeoutPreemptively
public static void assertTimeoutPreemptively(java.time.Duration timeout, Executable executable, java.lang.String message)Assert that execution of the suppliedexecutablecompletes before the giventimeoutis exceeded.Note: the
executablewill be executed in a different thread than that of the calling code. Furthermore, execution of theexecutablewill be preemptively aborted if the timeout is exceeded. See the Preemptive Timeouts section of the class-level Javadoc for a discussion of possible undesirable side effects.Fails with the supplied failure
message.- See Also:
assertTimeoutPreemptively(Duration, Executable),assertTimeoutPreemptively(Duration, Executable, Supplier),assertTimeoutPreemptively(Duration, ThrowingSupplier),assertTimeoutPreemptively(Duration, ThrowingSupplier, String),assertTimeoutPreemptively(Duration, ThrowingSupplier, Supplier),assertTimeout(Duration, Executable, String)
-
assertTimeoutPreemptively
public static void assertTimeoutPreemptively(java.time.Duration timeout, Executable executable, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that execution of the suppliedexecutablecompletes before the giventimeoutis exceeded.Note: the
executablewill be executed in a different thread than that of the calling code. Furthermore, execution of theexecutablewill be preemptively aborted if the timeout is exceeded. See the Preemptive Timeouts section of the class-level Javadoc for a discussion of possible undesirable side effects.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- See Also:
assertTimeoutPreemptively(Duration, Executable),assertTimeoutPreemptively(Duration, Executable, String),assertTimeoutPreemptively(Duration, ThrowingSupplier),assertTimeoutPreemptively(Duration, ThrowingSupplier, String),assertTimeoutPreemptively(Duration, ThrowingSupplier, Supplier),assertTimeout(Duration, Executable, Supplier)
-
assertTimeoutPreemptively
public static <T> T assertTimeoutPreemptively(java.time.Duration timeout, ThrowingSupplier<T> supplier)Assert that execution of the suppliedsuppliercompletes before the giventimeoutis exceeded.If the assertion passes then the
supplier's result is returned.Note: the
supplierwill be executed in a different thread than that of the calling code. Furthermore, execution of thesupplierwill be preemptively aborted if the timeout is exceeded. See the Preemptive Timeouts section of the class-level Javadoc for a discussion of possible undesirable side effects.- See Also:
assertTimeoutPreemptively(Duration, Executable),assertTimeoutPreemptively(Duration, Executable, String),assertTimeoutPreemptively(Duration, Executable, Supplier),assertTimeoutPreemptively(Duration, ThrowingSupplier, String),assertTimeoutPreemptively(Duration, ThrowingSupplier, Supplier),assertTimeout(Duration, Executable)
-
assertTimeoutPreemptively
public static <T> T assertTimeoutPreemptively(java.time.Duration timeout, ThrowingSupplier<T> supplier, java.lang.String message)Assert that execution of the suppliedsuppliercompletes before the giventimeoutis exceeded.If the assertion passes then the
supplier's result is returned.Note: the
supplierwill be executed in a different thread than that of the calling code. Furthermore, execution of thesupplierwill be preemptively aborted if the timeout is exceeded. See the Preemptive Timeouts section of the class-level Javadoc for a discussion of possible undesirable side effects.Fails with the supplied failure
message.- See Also:
assertTimeoutPreemptively(Duration, Executable),assertTimeoutPreemptively(Duration, Executable, String),assertTimeoutPreemptively(Duration, Executable, Supplier),assertTimeoutPreemptively(Duration, ThrowingSupplier),assertTimeoutPreemptively(Duration, ThrowingSupplier, Supplier),assertTimeout(Duration, Executable, String)
-
assertTimeoutPreemptively
public static <T> T assertTimeoutPreemptively(java.time.Duration timeout, ThrowingSupplier<T> supplier, java.util.function.Supplier<java.lang.String> messageSupplier)Assert that execution of the suppliedsuppliercompletes before the giventimeoutis exceeded.If the assertion passes then the
supplier's result is returned.Note: the
supplierwill be executed in a different thread than that of the calling code. Furthermore, execution of thesupplierwill be preemptively aborted if the timeout is exceeded. See the Preemptive Timeouts section of the class-level Javadoc for a discussion of possible undesirable side effects.If necessary, the failure message will be retrieved lazily from the supplied
messageSupplier.- See Also:
assertTimeoutPreemptively(Duration, Executable),assertTimeoutPreemptively(Duration, Executable, String),assertTimeoutPreemptively(Duration, Executable, Supplier),assertTimeoutPreemptively(Duration, ThrowingSupplier),assertTimeoutPreemptively(Duration, ThrowingSupplier, String),assertTimeout(Duration, Executable, Supplier)
-
-