← 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 annotation in Spring Boot Test is used to auto-configure a TestRestTemplate for full integration tests?

    Answer: @SpringBootTest with webEnvironment = RANDOM_PORT

    When @SpringBootTest uses RANDOM_PORT or DEFINED_PORT, Spring Boot auto-configures a TestRestTemplate bean for HTTP client testing.

  2. In Spring's testing support, what does ApplicationContext caching mean?

    Answer: The ApplicationContext is reused across tests with the same configuration, reducing startup time

    Spring's TestContext Framework caches the ApplicationContext so tests sharing the same configuration reuse the same context, speeding up test suites.

  3. What is the effect of @DirtiesContext on the Spring test ApplicationContext?

    Answer: Clears the context cache so a fresh context is created for subsequent tests

    @DirtiesContext forces Spring to close and recreate the ApplicationContext after the annotated test, useful when a test modifies shared state.

  4. Which Spring Boot testing slice would you use to test a REST client that calls an external API, with the HTTP layer mocked?

    Answer: @RestClientTest

    @RestClientTest configures a MockRestServiceServer to intercept and verify HTTP calls made by RestTemplate or RestClient beans.

  5. In Spring MVC tests, what does .andExpect(status().isOk()) verify?

    Answer: The HTTP response status code is 200

    status().isOk() is a ResultMatcher that asserts the HTTP response status is 200 OK.

  6. What is the purpose of WireMock when used in Spring Boot integration tests?

    Answer: Stubs and verifies HTTP interactions with external services

    WireMock runs a real HTTP server that stubs responses and verifies request interactions, enabling tests of HTTP client code against realistic endpoints.

  7. Which Mockito method call pattern is used to stub a method on a @MockBean to return a specific value?

    Answer: when(bean.method()).thenReturn(value)

    Mockito's when().thenReturn() pattern stubs a method call on a mock to return a predefined value when invoked.

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