Skip to content
Sharp

Testing · interview question

In a Gradle project, how can you ensure that integration tests run only after the application has been successfully built?

Multiple choiceHardchapter-10-curatedpremiumtestingunit-testing-with-junit
Choose one answer
Answer and explanation

Correct answer

B. Make integration tests a dependent task of the build task

Why

By making integration tests a dependent task of the build task, Gradle ensures that the application is successfully built before running integration tests. This ensures that tests are always run on the latest build artifacts.

Test yourself on Testing

A free test with instant, explained results. No account needed.

Start free test
All Testing questions →