Bird
0
0

A developer placed test resource files in src/main/resources instead of src/test/resources. What is the likely impact when running tests?

medium📝 Debug Q7 of 15
Spring Boot - Fundamentals
A developer placed test resource files in src/main/resources instead of src/test/resources. What is the likely impact when running tests?
AThe resources will be ignored during build
BTests may fail because test resources are not found in the expected location
CThe application will fail to start
DTests will run normally without issues
Step-by-Step Solution
Solution:
  1. Step 1: Understand resource separation

    Test resources should be in src/test/resources to be available during test execution.
  2. Step 2: Recognize impact of wrong placement

    If test resources are in main resources, tests may not find them and fail.
  3. Final Answer:

    Tests may fail because test resources are not found in the expected location -> Option B
  4. Quick Check:

    Test resources belong in src/test/resources [OK]
Quick Trick: Put test resources in src/test/resources for tests to find them [OK]
Common Mistakes:
  • Placing test resources in main resources folder
  • Assuming test resources are loaded from main resources
  • Ignoring resource folder separation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes