🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Testing Spring Boot: all 10 questions

Quiz: Testing Spring Boot · Question 5 of 10

In Spring Boot 4, which annotation replaces a bean with a Mockito mock in a Spring test?

In Spring Boot 4, which annotation replaces a bean with a Mockito mock in a Spring test?

  1. A.@Mock
  2. B.@Spy
  3. C.@MockitoBean
  4. D.@Fake
Answer & explanation

Correct answer: @MockitoBean

@MockBean was deprecated and replaced by @MockitoBean.

Can you get the rest right without peeking?

Take the timed Quiz: Testing Spring Boot quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →