public class SpringBootMockServletContext extends MockServletContext
MockServletContext
implementation for Spring Boot. Respects well-known Spring
Boot resource locations and uses an empty directory for "/" if no locations can be
found.ORDERED_LIBS, TEMPDIR
Constructor and Description |
---|
SpringBootMockServletContext(String resourceBasePath) |
SpringBootMockServletContext(String resourceBasePath,
ResourceLoader resourceLoader) |
Modifier and Type | Method and Description |
---|---|
URL |
getResource(String path) |
protected String |
getResourceBasePathLocation(String path) |
protected String |
getResourceLocation(String path) |
addFilter, addFilter, addFilter, addInitParameter, addJspFile, addListener, addListener, addListener, addMimeType, addServlet, addServlet, addServlet, createFilter, createListener, createServlet, declareRoles, getAttribute, getAttributeNames, getClassLoader, getContext, getContextPath, getDeclaredRoles, getDefaultServletName, getDefaultSessionTrackingModes, getEffectiveMajorVersion, getEffectiveMinorVersion, getEffectiveSessionTrackingModes, getFilterRegistration, getFilterRegistrations, getInitParameter, getInitParameterNames, getJspConfigDescriptor, getMajorVersion, getMimeType, getMinorVersion, getNamedDispatcher, getRealPath, getRequestCharacterEncoding, getRequestDispatcher, getResourceAsStream, getResourcePaths, getResponseCharacterEncoding, getServerInfo, getServlet, getServletContextName, getServletNames, getServletRegistration, getServletRegistrations, getServlets, getSessionCookieConfig, getSessionTimeout, getVirtualServerName, log, log, log, registerContext, registerNamedDispatcher, removeAttribute, setAttribute, setContextPath, setDefaultServletName, setEffectiveMajorVersion, setEffectiveMinorVersion, setInitParameter, setMajorVersion, setMinorVersion, setRequestCharacterEncoding, setResponseCharacterEncoding, setServletContextName, setSessionTimeout, setSessionTrackingModes, unregisterNamedDispatcher
public SpringBootMockServletContext(String resourceBasePath)
public SpringBootMockServletContext(String resourceBasePath, ResourceLoader resourceLoader)
protected String getResourceLocation(String path)
getResourceLocation
in class MockServletContext
public URL getResource(String path) throws MalformedURLException
getResource
in interface ServletContext
getResource
in class MockServletContext
MalformedURLException