← 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?
- A.@Mock
- B.@Spy
- C.@MockitoBean
- 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 →