Recall & Review
beginner
What is the Maven Surefire plugin used for?
The Maven Surefire plugin runs unit tests during the build process. It helps check if your code works as expected before packaging.
Click to reveal answer
intermediate
How do you specify which tests to run with Maven Surefire?
You can use the
includes and excludes tags in the plugin configuration to select test files by name patterns.Click to reveal answer
beginner
What is the default test file naming pattern for Maven Surefire?
By default, Surefire runs tests matching
**/Test*.java, **/*Test.java, and **/*Tests.java.Click to reveal answer
beginner
How can you skip tests when running Maven build with Surefire?
You can skip tests by adding
-DskipTests=true to the Maven command. This speeds up the build but skips test verification.Click to reveal answer
beginner
What happens if a test fails during the Maven Surefire plugin execution?
If a test fails, Surefire marks the build as failed and stops the build process unless configured to continue.
Click to reveal answer
What is the main role of the Maven Surefire plugin?
✗ Incorrect
Maven Surefire plugin is designed to run unit tests during the build process.
Which file naming pattern does Surefire use by default to find tests?
✗ Incorrect
Surefire looks for test files starting with 'Test' or ending with 'Test' or 'Tests' by default.
How do you skip tests when running Maven with Surefire?
✗ Incorrect
The correct property to skip tests is '-DskipTests=true'.
If a test fails during Surefire execution, what happens by default?
✗ Incorrect
By default, Surefire fails the build if any test fails.
Where do you configure the Maven Surefire plugin?
✗ Incorrect
Surefire plugin configuration is done inside the section of the pom.xml file.
Explain how Maven Surefire plugin helps in the software build process.
Think about what happens when you build your project and want to be sure your code works.
You got /4 concepts.
Describe how to configure Maven Surefire plugin to run only specific tests.
Focus on how to tell Surefire which tests to run or skip.
You got /4 concepts.