Annotations Flashcards
This annotation marks a method as a test method.
@Test:
Used to indicate that a method should be run once before all the tests in the class.
@BeforeAll
Used to indicate that a method should be run before each test in the class.
@BeforeEach
Used to indicate that a method should be run once after all the tests in the class.
@AfterAll:
Used to indicate that a method should be run after each test in the class.
@AfterEach:
checks that the expected value is equal to the actual value.
assertEquals
checks that the given condition is true.
assertTrue
checks that the given condition is false.
assertFalse
checks that the given object is null.
assertNull
checks that the given executable (a lambda or method reference) throws an exception of the specified type.
assertThrows
checks that the given object is not null.
assertNotNul