Class Asserts
- java.lang.Object
-
- org.opendaylight.infrautils.testutils.Asserts
-
@Deprecated(forRemoval=true) public final class Asserts extends Object
Deprecated, for removal: This API element is subject to removal in a future version.JUnit 4.13 ships with a workingassertThrows(Class, JUnitExecutable)
, so there is no point shipping this class.Assert extension for JUnit.Including some JUnit v5 NG APIs for JUnit 4 already.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Asserts.JUnitExecutable
Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <T extends Throwable>
TassertThrows(Class<T> expectedThrowable, Asserts.JUnitExecutable exec)
Deprecated, for removal: This API element is subject to removal in a future version.UseAssert.assertThrows(Class, org.junit.function.ThrowingRunnable)
instead.
-
-
-
Method Detail
-
assertThrows
@Deprecated(forRemoval=true) public static <T extends Throwable> T assertThrows(Class<T> expectedThrowable, Asserts.JUnitExecutable exec)
Deprecated, for removal: This API element is subject to removal in a future version.UseAssert.assertThrows(Class, org.junit.function.ThrowingRunnable)
instead.Asserts that execution of the supplied executable throws an exception of the expectedType and returns the exception.This is useful to avoid (and comply with) Error Prone's TestExceptionChecker bug pattern.
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.
Back-ported from org.junit.jupiter.api.Assertions.
-
-