Spring Certified Professional 2023 · Free Practice Question Easy
Question 11
Which of the following is NOT auto-configured when using @WebMvcTest?
-
A
Jackson
-
B
Caching
-
C
Templating engine
-
D
Transaction
Reveal correct answer
Correct answer: D
Explanation
Here the autoconfiguration for @WebMvcTest:
@WebMvcTest
org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration (check) org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration org.springframework.boot.autoconfigure.groovy.template.GroovyTemplateAutoConfiguration (check)
org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration (check)
org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration org.springframework.boot.test.autoconfigure.web.servlet.MockMvcAutoConfiguration org.springframework.boot.test.autoconfigure.web.servlet.MockMvcSecurityAutoConfiguration org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebClientAutoConfiguration org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebDriverAutoConfiguration
https://docs.spring.io/spring-boot/docs/1.5.2.RELEASE/reference/html/test-auto-configuration.html
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
