JavaScript isn't enabled in your browser, so this file can't be opened. Enable and reload.
Quiz #8 (JUnit) - CPSAT Foundation Preparation Series
Quiz by Agile Testing Alliance
* Indicates required question
Email
*
Record my email address with my response
Does a failing JUnit test stop the entire test suite from running?
True
False
It depends on the JUnit version
Only if the test is marked with a special annotation
Clear selection
Do all JUnit tests within the same class share the same instance of the test class?
True
False
It depends on the JUnit version
Only if explicitly configured
Clear selection
What is the behavior of
@BeforeEach
methods in JUnit?
They run before each test method in the test class.
They run after each test method in the test class.
They run before all test methods in the test class.
They run after all test methods in the test class.
Clear selection
What does the
@AfterEach
annotation in JUnit signify?
It marks a method that runs before each test method in the test class.
It marks a method that runs after each test method in the test class.
It marks a method that runs before all test methods in the test class.
It marks a method that runs after all test methods in the test class.
Clear selection
Can "
@BeforeEach'
and '
@AfterEach'
annotations be used in JUnit 4?
Yes
No
Partially
Only in certain circumstances
Clear selection
@Test annotation methods in JUnit must return void.
True
False
Clear selection
Is the
@Test
annotation mandatory for a method to be considered a test case in JUnit?
True
False
It depends on the version of JUnit
Only if using JUnit 5
Clear selection
What is the purpose of the
@Test
annotation in JUnit?
It marks a method as a helper method.
It marks a method as a test method.
It marks a method as a setup method.
It marks a method as a teardown method.
Clear selection
All test methods must be public in JUnit.
True
False
Clear selection
Annotations like @Before and @After exist in JUnit.
True
False
Clear selection
All JUnit test methods must return void.
True
False
Clear selection
All assertion methods in JUnit throw exceptions.
True
False
Clear selection
@BeforeAll and @AfterAll methods must be static in JUnit 5.
True
False
Clear selection
All JUnit tests require a main method to run.
True
False
Clear selection
A JUnit class can have only one @BeforeAll method.
True
False
Clear selection
@Test methods in JUnit 5 need to be public.
True
False
Clear selection
@AfterAll runs after all test methods in the current class.
True
False
Clear selection
@After is used to clean up resources after each test in JUnit 4.
True
False
Clear selection
@Test methods in JUnit 5 can be private.
True
False
Clear selection
Which version of JUnit introduced the
@Before
and
@After
annotations?
JUnit 3
JUnit 4
JUnit 5
JUnit 6
Clear selection
Submit
Page 1 of 1
Clear form
Forms
This content is neither created nor endorsed by Google.
Report Abuse
Terms of Service
Privacy Policy
Help and feedback
Contact form owner
Help Forms improve
Report