Search the courses, subjects, tracks, games and features, or jump straight to a page.
5 cards from this section. Quick, good the night before a test.
What does the @Test annotation do?
Think about how JUnit knows what to run.
What is the purpose of @Disabled?
Consider how you would mark a test that isn’t ready.
What does the @Test annotation signify?
This is the core annotation for creating unit tests.
True or False: The @AfterEach annotation runs after each test method.
Consider the lifecycle of the test method.
Create a JUnit test class for a library system where you manage book loans. Use both @BeforeAll and @AfterAll to handle setup and teardown processes, and demonstrate usage of other annotations.
Think of how sections of your library can share the same resources.
Describe a scenario in your ongoing project where using @Disabled would be appropriate and explain your reasoning.
Consider times when you are actively coding a feature and tests don't reflect the current state.
5 more questions in this section. Enroll free to practise them all.
Enroll free