@groovy.transform.Trait @groovy.transform.CompileStatic @groovy.util.logging.Slf4j trait GrailsWebUnitTest extends java.lang.Object implements GrailsUnitTest
Modifiers | Name | Description |
---|---|---|
private static java.util.Map<java.lang.String, java.lang.String> |
groovyPages |
|
private java.util.Set<java.lang.Class> |
loadedCodecs |
|
private GrailsWebRequest |
webRequest |
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 |
|
private GrailsClass |
createAndEnhanceController(java.lang.Class controllerClass) |
|
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()
|
|
java.util.Map<java.lang.String, java.lang.String> |
getViews() |
|
void |
mockCodec(java.lang.Class<?> codecClass, boolean reinitialize) |
|
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 |
|
private java.lang.Object |
renderTemplateToStringWriter(java.io.StringWriter sw, groovy.text.Template t, java.util.Map params) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
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 @return
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