Testing · interview question
In a Gradle project, how can you ensure that integration tests are only run after unit tests have passed?
Multiple choiceHardchapter-10-curatedpremiumtestingintegration-testing
Answer and explanation
Correct answer
D. Define task dependencies so that integration tests depend on unit test completion.
Why
In Gradle, you can define task dependencies to ensure that unit tests must pass before the integration tests are run. This ensures that any failed unit tests block integration tests from executing.
Test yourself on Testing
A free test with instant, explained results. No account needed.
More Testing questions
- Why might you choose to use integration tests over unit tests for certain components in an e-commerce application?
- Which benefit of automated unit testing is most critical for maintaining large Java projects?
- How would you explain a significant advantage of using mocks at the boundary of a system, rather than the internals in…
- Why do teams use Mockito for mocking dependencies in tests in production code?
- In a unit test using Mockito, why would you use 'when-thenReturn'?
- When using Testcontainers for integration testing, why might a developer choose to reuse containers across tests?