|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD |
java.lang.Object grails.test.mixin.support.GrailsUnitTestMixin grails.test.mixin.web.ControllerUnitTestMixin
class ControllerUnitTestMixin extends GrailsUnitTestMixin
A mixin that can be applied to a unit test in order to test controllers.
Property Summary | |
---|---|
static java.util.Map |
groovyPages
Used to define additional GSP pages or templates where the key is the path to the template and the value is the contents of the template. |
GrailsMockHttpServletRequest |
request
The GrailsMockHttpServletRequest object |
GrailsMockHttpServletResponse |
response
The GrailsMockHttpServletResponse object |
static org.springframework.mock.web.MockServletContext |
servletContext
The ServletContext |
static java.util.Map |
views
Used to define additional GSP pages or templates where the key is the path to the template and the value is the contents of the template. |
GrailsWebRequest |
webRequest
The GrailsWebRequest object |
Method Summary | |
---|---|
void
|
bindGrailsWebRequest()
|
static void
|
cleanupGrailsWeb()
|
void
|
clearGrailsWebRequest()
|
static void
|
configureGrailsWeb()
|
FlashScope
|
getFlash()
The Grails 'flash' object @return |
java.util.Map
|
getModel()
@return The model of the current controller |
GrailsParameterMap
|
getParams()
The Grails 'params' object which is an instance of GrailsParameterMap |
org.springframework.mock.web.MockHttpSession
|
getSession()
The org.springframework.mock.web.MockHttpSession instance |
java.lang.String
|
getView()
@return The view of the current controller |
java.lang.Object
|
mockCommandObject(java.lang.Class commandClass)
Mocks a Grails command object providing the necessary validation behavior and returning the instance |
java.lang.Object
|
mockController(java.lang.Class controllerClass)
Mocks a Grails controller class, providing the needed behavior and defining it in the ApplicationContext |
java.lang.Object
|
testFor(java.lang.Class controllerClass)
Signifies that the given controller class is the class under test |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#wait(long), 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() |
Property Detail |
---|
static java.util.Map groovyPages
GrailsMockHttpServletRequest request
GrailsMockHttpServletResponse response
static org.springframework.mock.web.MockServletContext servletContext
static java.util.Map views
GrailsWebRequest webRequest
Method Detail |
---|
@Before void bindGrailsWebRequest()
@AfterClass static void cleanupGrailsWeb()
@After void clearGrailsWebRequest()
@BeforeClass static void configureGrailsWeb()
FlashScope getFlash()
java.util.Map getModel()
GrailsParameterMap getParams()
org.springframework.mock.web.MockHttpSession getSession()
java.lang.String getView()
java.lang.Object mockCommandObject(java.lang.Class commandClass)
commandClass
- The command class
java.lang.Object mockController(java.lang.Class controllerClass)
controllerClass
- The controller class
java.lang.Object testFor(java.lang.Class controllerClass)
controllerClass
- The controller class
Groovy Documentation