In JUnit, which annotation is used to execute a method before each test method in the test class?
- @BeforeClass
- @BeforeEach
- @BeforeMethod
- @BeforeTest
In JUnit, the @BeforeEach annotation is used to execute a method before each test method in the test class. This is often used for setup operations required before each test case.
Loading...
Related Quiz
- The _____ annotation in Spring Boot is used to provide global exception handling across all @Controller classes.
- What components are typically scanned and loaded when a test is annotated with @DataJpaTest in Spring Boot?
- How can you access a defined property in the application properties file within a Spring Boot application class?
- In a Spring Boot application, the _____ annotation is used to demarcate transaction boundaries.
- How can you customize the response message sent to the client when a validation error occurs?