@groovy.transform.CompileStatic @groovy.util.logging.Slf4j trait GrailsWebUnitTest
Type | Name and description |
---|---|
static java.util.Map<java.lang.String, java.lang.String> |
groovyPages |
GrailsWebRequest |
webRequest |
Type Params | Return Type | Name and description |
---|---|---|
|
java.lang.String |
applyTemplate(java.lang.String contents, java.util.Map model = [:]) Renders a template for the given contents and model |
|
void |
applyTemplate(java.io.StringWriter sw, java.lang.String template, java.util.Map params = [:]) Renders a template for the given contents and model to the provided writer |
|
FlashScope |
getFlash() The Grails 'flash' object @return |
|
GrailsParameterMap |
getParams() The Grails 'params' object which is an instance of grails.web.servlet.mvc.GrailsParameterMap |
|
GrailsMockHttpServletRequest |
getRequest() |
|
GrailsMockHttpServletResponse |
getResponse() |
|
MockServletContext |
getServletContext() |
|
MockHttpSession |
getSession() The org.springframework.mock.web.MockHttpSession instance |
|
int |
getStatus() @return The status code of the response |
|
java.util.Map<java.lang.String, java.lang.String> |
getViews() |
|
void |
mockCodec(java.lang.Class<?> codecClass, boolean reinitialize = true) |
|
java.lang.Object |
mockController(java.lang.Class<?> controllerClass) |
|
java.lang.Object |
mockTagLib(java.lang.Class<?> tagLibClass) |
|
void |
mockTagLibs(java.lang.Class<?>... tagLibClasses) |
|
java.lang.String |
render(java.util.Map args) Mimics the behavior of the render method in controllers but returns the rendered contents directly |
Renders a template for the given contents and model
contents
- The contentsmodel
- The modelRenders a template for the given contents and model to the provided writer
sw
- The write to write the rendered template tocontents
- The contentsmodel
- The modelThe Grails 'flash' object
The Grails 'params' object which is an instance of grails.web.servlet.mvc.GrailsParameterMap
The org.springframework.mock.web.MockHttpSession instance
Mimics the behavior of the render method in controllers but returns the rendered contents directly
args
- The same arguments as the controller render method accepts