Package org.junit.jupiter.api.function
Interface Executable
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface @API(status=STABLE, since="5.0") public interface ExecutableExecutableis a functional interface that can be used to implement any generic block of code that potentially throws aThrowable.The
Executableinterface is similar toRunnable, except that anExecutablecan throw any kind of exception.Rationale for throwing
Throwableinstead ofExceptionAlthough Java applications typically throw exceptions that are instances of
Exception,RuntimeException,Error, orAssertionError(in testing scenarios), there may be use cases where anExecutableneeds to explicitly throw aThrowable. In order to support such specialized use cases,execute()is declared to throwThrowable.- Since:
- 5.0
- See Also:
Assertions.assertAll(Executable...),Assertions.assertAll(String, Executable...),Assertions.assertThrows(Class, Executable),Assumptions.assumingThat(java.util.function.BooleanSupplier, Executable),DynamicTest.dynamicTest(String, Executable),ThrowingConsumer,ThrowingSupplier
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidexecute()
-