← All Spring Framework Flashcard Decks

Quality Control & Assurance Flashcards

7 cards from real Spring Framework practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 7 Quality Control & Assurance flashcards as text
  1. Which Spring Test annotation loads only a subset of the application context for testing the web layer without starting a full server?

    Answer: @WebMvcTest

    @WebMvcTest loads only MVC components like controllers, filters, and WebMvcConfigurer beans, not the full context.

  2. In Spring Boot, what does the @DataJpaTest annotation do by default regarding the datasource?

    Answer: Configures an in-memory embedded database

    @DataJpaTest replaces the configured datasource with an embedded in-memory database by default for isolated repository testing.

  3. Which assertion library is commonly used with Spring Boot Test to provide more readable assertions like assertThat(value).isEqualTo(expected)?

    Answer: AssertJ

    AssertJ provides a fluent API with assertThat() that Spring Boot Test auto-imports via spring-boot-starter-test.

  4. What is the purpose of @MockBean in a Spring Boot test?

    Answer: Creates a real Spring bean backed by a mock object and adds it to the ApplicationContext

    @MockBean creates a Mockito mock and registers it as a Spring bean, replacing any existing bean of the same type in the context.

  5. When using MockMvc, which method is used to simulate an HTTP GET request to a controller endpoint?

    Answer: mockMvc.perform(get("/path"))

    MockMvc.perform() accepts a RequestBuilder such as MockMvcRequestBuilders.get() to simulate HTTP requests in tests.

  6. Which Spring annotation can be applied to a test class to replace beans with Spy objects that wrap real implementations?

    Answer: @SpyBean

    @SpyBean wraps an existing Spring bean with a Mockito spy, allowing partial mocking while retaining real method behavior.

  7. In a Spring Boot integration test, what does setting webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT do?

    Answer: Starts an embedded server on a randomly chosen available port

    RANDOM_PORT starts a real embedded web server on a random available port, preventing port conflicts during parallel test execution.

How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy

Sources & references

Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy

  1. docs.broadcom.com — Test delivery, retake policy, exam information · verified Oct 2026
  2. spring-academy.broadcom.com — Eligibility · verified Oct 2026
  3. broadcom.com — Fees, exam format, passing score, time limit · verified Oct 2026