Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What does the @Test annotation do?
Think about how JUnit identifies tests.
What is the purpose of assertNull?
Consider what null means in programming.
What is the purpose of the @Test annotation?
Think about how JUnit recognizes tests.
True or False: The @BeforeAll annotation runs before each individual test.
Think about the execution frequency of the annotations.
Write a unit test for a method that checks if a number is even. Include both a positive and negative test case.
Consider the mathematical operation for evenness.
How would you refactor a test to use @BeforeEach for setting up common resources?
Think about what setups are common in multiple tests.
6 more questions in this section. Enroll free to practise them all.
Enroll free