程序包的使用
org.springframework.test.web.servlet.setup
使用org.springframework.test.web.servlet.setup的程序包 程序包 说明 org.springframework.test.web.servlet.htmlunit Server-side support for testing Spring MVC applications withMockMvc
and HtmlUnit.org.springframework.test.web.servlet.htmlunit.webdriver Server-side support for testing Spring MVC applications withMockMvc
and the SeleniumHtmlUnitDriver
.org.springframework.test.web.servlet.setup Contains built-inMockMvcBuilder
implementations.org.springframework.test.web.servlet.htmlunit使用的org.springframework.test.web.servlet.setup中的类 类 说明 MockMvcConfigurer Contract for customizing aConfigurableMockMvcBuilder
in some specific way, e.g. a 3rd party library that wants to provide shortcuts for setting up a MockMvc.org.springframework.test.web.servlet.htmlunit.webdriver使用的org.springframework.test.web.servlet.setup中的类 类 说明 MockMvcConfigurer Contract for customizing aConfigurableMockMvcBuilder
in some specific way, e.g. a 3rd party library that wants to provide shortcuts for setting up a MockMvc.org.springframework.test.web.servlet.setup使用的org.springframework.test.web.servlet.setup中的类 类 说明 AbstractMockMvcBuilder Abstract implementation ofMockMvcBuilder
with common methods for configuring filters, default request properties, global expectations and global result actions.ConfigurableMockMvcBuilder Defines common methods for building aMockMvc
.DefaultMockMvcBuilder A concrete implementation ofAbstractMockMvcBuilder
that provides theWebApplicationContext
supplied to it as a constructor argument.MockMvcConfigurer Contract for customizing aConfigurableMockMvcBuilder
in some specific way, e.g. a 3rd party library that wants to provide shortcuts for setting up a MockMvc.SharedHttpSessionConfigurer MockMvcConfigurer
that stores and re-uses the HTTP session across multiple requests performed through the sameMockMvc
instance.StandaloneMockMvcBuilder AMockMvcBuilder
that accepts@Controller
registrations thus allowing full control over the instantiation and initialization of controllers and their dependencies similar to plain unit tests, and also making it possible to test one controller at a time.