@Trait @CompileStatic @Slf4j trait GrailsWebUnitTest extends Object implements GrailsUnitTest
Type | Name and description |
---|---|
static Map<String, String> |
groovyPages |
GrailsWebRequest |
webRequest |
Type Params | Return Type | Name and description |
---|---|---|
|
String |
applyTemplate(String contents, Map model) Renders a template for the given contents and model |
|
void |
applyTemplate(StringWriter sw, String template, 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 GrailsParameterMap |
|
GrailsMockHttpServletRequest |
getRequest() |
|
GrailsMockHttpServletResponse |
getResponse() |
|
MockServletContext |
getServletContext() |
|
MockHttpSession |
getSession() The org.springframework.mock.web.MockHttpSession instance |
|
int |
getStatus()
|
|
Map<String, String> |
getViews() |
|
void |
mockCodec(Class<?> codecClass, boolean reinitialize) |
|
Object |
mockController(Class<?> controllerClass) |
|
Object |
mockTagLib(Class<?> tagLibClass) |
|
void |
mockTagLibs(Class<?>[] tagLibClasses) |
|
String |
render(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 @return
The Grails 'params' object which is an instance of GrailsParameterMap
The org.springframework.mock.web.MockHttpSession instance