Package org.verifyica.api
Class Trap
java.lang.Object
org.verifyica.api.Trap
Class to implement Trap
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAssert that no Throwable was trappedstatic voidassertEmpty(Collection<Trap> traps) Assert that no Throwables were trappedstatic voidassertEmpty(Trap trap) Assert that no Throwable was trappedstatic voidassertEmpty(Trap... traps) Assert that no Throwables were trappedbooleanisEmpty()Checks if a Throwable was trappedGet the Throwable if trapped
-
Constructor Details
-
Trap
Constructor- Parameters:
runnable- runnable
-
-
Method Details
-
throwable
Get the Throwable if trapped- Returns:
- an Optional containing the trapped Throwable or an empty Optional if no Throwable was trapped
-
isEmpty
public boolean isEmpty()Checks if a Throwable was trapped- Returns:
- true if no Throwable was trapped, else false
-
assertEmpty
Assert that no Throwable was trapped- Throws:
Throwable- The trapped Throwable
-
assertEmpty
Assert that no Throwable was trapped- Parameters:
trap- trap- Throws:
Throwable- the first trapped Throwable
-
assertEmpty
Assert that no Throwables were trapped- Parameters:
traps- traps- Throws:
Throwable- the first trapped Throwable
-
assertEmpty
Assert that no Throwables were trapped- Parameters:
traps- traps- Throws:
Throwable- the first trapped Throwable
-