Skills101
← All practice quizzes

Quiz: Testing Spring Boot

5 questionsNo time limitPass: 60%+10 XP on first pass

Test a Spring Boot app at every level: fast unit tests with JUnit 5 and Mockito, web-layer slices with @WebMvcTest and MockMvc, repository tests with @DataJpaTest, and full integration tests that log in and call the API.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    Which annotation starts only the web layer for one controller?

  2. Question 2

    In a Mockito test, what does @InjectMocks do?

  3. Question 3

    How do you check that deleteById was NOT called?

  4. Question 4

    What does @DataJpaTest do after each test by default?

  5. Question 5

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