Uses of Annotation Interface
org.junit.platform.commons.annotation.Contract
Packages that use Contract
Package
Description
JUnit Jupiter API for writing tests.
Common support APIs provided by the JUnit Platform.
Internal common utilities for JUnit.
-
Uses of Contract in org.junit.jupiter.api
Methods in org.junit.jupiter.api with annotations of type ContractModifier and TypeMethodDescriptionstatic <V> V
Assumptions.abort()
Abort the test without a message.static <V> V
Abort the test with the givenmessage
.static <V> V
Abort the test with the supplied message.static void
Assertions.assertFalse
(boolean condition) Assert that the suppliedcondition
isfalse
.static void
Assertions.assertFalse
(boolean condition, @Nullable String message) Assert that the suppliedcondition
isfalse
.static void
Assertions.assertFalse
(boolean condition, Supplier<@Nullable String> messageSupplier) Assert that the suppliedcondition
isfalse
.static <T> T
Assertions.assertInstanceOf
(Class<T> expectedType, @Nullable Object actualValue) Assert that the suppliedactualValue
is an instance of theexpectedType
.static <T> T
Assertions.assertInstanceOf
(Class<T> expectedType, @Nullable Object actualValue, @Nullable String message) Assert that the suppliedactualValue
is an instance of theexpectedType
.static <T> T
Assertions.assertInstanceOf
(Class<T> expectedType, @Nullable Object actualValue, Supplier<@Nullable String> messageSupplier) Assert that the suppliedactualValue
is an instance of theexpectedType
.static void
Assertions.assertNotNull
(@Nullable Object actual) Assert thatactual
is notnull
.static void
Assertions.assertNotNull
(@Nullable Object actual, @Nullable String message) Assert thatactual
is notnull
.static void
Assertions.assertNotNull
(@Nullable Object actual, Supplier<@Nullable String> messageSupplier) Assert thatactual
is notnull
.static void
Assertions.assertNull
(@Nullable Object actual) Assert thatactual
isnull
.static void
Assertions.assertNull
(@Nullable Object actual, @Nullable String message) Assert thatactual
isnull
.static void
Assertions.assertNull
(@Nullable Object actual, Supplier<@Nullable String> messageSupplier) Assert thatactual
isnull
.static void
Assertions.assertTrue
(boolean condition) Assert that the suppliedcondition
istrue
.static void
Assertions.assertTrue
(boolean condition, @Nullable String message) Assert that the suppliedcondition
istrue
.static void
Assertions.assertTrue
(boolean condition, Supplier<@Nullable String> messageSupplier) Assert that the suppliedcondition
istrue
.static void
Assumptions.assumeFalse
(boolean assumption) Validate the given assumption.static void
Assumptions.assumeFalse
(boolean assumption, @Nullable String message) Validate the given assumption.static void
Assumptions.assumeFalse
(boolean assumption, Supplier<@Nullable String> messageSupplier) Validate the given assumption.static void
Assumptions.assumeTrue
(boolean assumption) Validate the given assumption.static void
Assumptions.assumeTrue
(boolean assumption, @Nullable String message) Validate the given assumption.static void
Assumptions.assumeTrue
(boolean assumption, Supplier<@Nullable String> messageSupplier) Validate the given assumption.static <V> V
Assertions.fail()
Fail the test without a failure message.static <V> V
Fail the test with the given failuremessage
.static <V> V
Fail the test with the given failuremessage
as well as the underlyingcause
.static <V> V
Fail the test with the given underlyingcause
.static <V> V
Fail the test with the failure message retrieved from the givenmessageSupplier
. -
Uses of Contract in org.junit.platform.commons.support
Methods in org.junit.platform.commons.support with annotations of type ContractModifier and TypeMethodDescriptionstatic boolean
AnnotationSupport.isAnnotated
(@Nullable AnnotatedElement element, Class<? extends Annotation> annotationType) Determine if an annotation ofannotationType
is either present or meta-present on the suppliedelement
.static boolean
AnnotationSupport.isAnnotated
(@Nullable Optional<? extends AnnotatedElement> element, Class<? extends Annotation> annotationType) Determine if an annotation ofannotationType
is either present or meta-present on the supplied optionalelement
. -
Uses of Contract in org.junit.platform.commons.util
Methods in org.junit.platform.commons.util with annotations of type ContractModifier and TypeMethodDescriptionstatic void
Assert that the suppliedpredicate
istrue
.static void
Assert that the suppliedpredicate
istrue
.static boolean
StringUtils.containsIsoControlCharacter
(@Nullable String str) Determine if the suppliedString
contains any ISO control characters.static <T extends Collection<?>>
@Nullable TPreconditions.containsNoNullElements
(@Nullable T collection, String message) Assert that the supplied collection contains nonull
elements.static <T extends Collection<?>>
@Nullable TPreconditions.containsNoNullElements
(@Nullable T collection, Supplier<String> messageSupplier) Assert that the supplied collection contains nonull
elements.static <T> T @Nullable []
Preconditions.containsNoNullElements
(T @Nullable [] array, String message) Assert that the supplied array contains nonull
elements.static <T> T @Nullable []
Preconditions.containsNoNullElements
(T @Nullable [] array, Supplier<String> messageSupplier) Assert that the supplied array contains nonull
elements.static boolean
StringUtils.containsWhitespace
(@Nullable String str) Determine if the suppliedString
contains any whitespace characters.static boolean
StringUtils.doesNotContainIsoControlCharacter
(@Nullable String str) Determine if the suppliedString
does not contain any ISO control characters.static boolean
StringUtils.doesNotContainWhitespace
(@Nullable String str) Determine if the suppliedString
does not contain any whitespace characters.static boolean
AnnotationUtils.isAnnotated
(@Nullable AnnotatedElement element, Class<? extends Annotation> annotationType) Determine if an annotation ofannotationType
is either present or meta-present on the suppliedelement
.static boolean
AnnotationUtils.isAnnotated
(@Nullable Optional<? extends AnnotatedElement> element, Class<? extends Annotation> annotationType) Determine if an annotation ofannotationType
is either present or meta-present on the supplied optionalelement
.static boolean
Determine if the suppliedString
is blank (i.e.,null
or consisting only of whitespace characters).static boolean
StringUtils.isNotBlank
(@Nullable String str) static String
Assert that the suppliedString
is not blank.static String
Assert that the suppliedString
is not blank.static int[]
Assert that the supplied array is neithernull
nor empty.static <T extends Collection<?>>
TAssert that the suppliedCollection
is neithernull
nor empty.static <T extends Collection<?>>
TAssert that the suppliedCollection
is neithernull
nor empty.static <T> T[]
Assert that the supplied array is neithernull
nor empty.static <T> T[]
Assert that the supplied array is neithernull
nor empty.static <T> T
Assert that the suppliedObject
is notnull
.static <T> T
Assert that the suppliedObject
is notnull
.static @Nullable String
StringUtils.replaceIsoControlCharacters
(@Nullable String str, String replacement) Replace all ISO control characters in the suppliedString
.static @Nullable String
StringUtils.replaceWhitespaceCharacters
(@Nullable String str, String replacement) Replace all whitespace characters in the suppliedString
.static RuntimeException
ExceptionUtils.throwAsUncheckedException
(Throwable t) Throw the suppliedThrowable
, masked as an unchecked exception.