A mixin for testing URL mappings in Grails.
Type | Name and description |
---|---|
void |
assertAction(java.lang.Object controller, java.lang.Object action, java.lang.Object url) Asserts an action exists for the specified controller name, action name and url |
void |
assertController(java.lang.Object controller, java.lang.Object url) asserts a controller exists for the specified name and url |
void |
assertForwardUrlMapping(java.lang.Object assertions, java.lang.Object url) |
void |
assertForwardUrlMapping(java.lang.Object assertions, java.lang.Object url, java.lang.Object paramAssertions) |
void |
assertReverseUrlMapping(java.util.Map assertions, java.lang.Object url) Asserts the given controller and action produce the given reverse URL mapping |
void |
assertReverseUrlMapping(java.util.Map assertions, java.lang.Object url, groovy.lang.Closure paramAssertions) Asserts the given controller and action produce the given reverse URL mapping |
void |
assertUrlMapping(java.util.Map assertions, java.lang.Object url) Asserts a URL mapping maps to the controller and action specified by named parameters. |
void |
assertUrlMapping(java.util.Map assertions, java.lang.Object url, groovy.lang.Closure paramAssertions) Asserts a URL mapping maps to the controller and action specified by named parameters. |
void |
assertView(java.lang.Object controller, java.lang.Object view, java.lang.Object url) Asserts a view exists for the specified controller name, view name and url |
UrlMappingsHolder |
getUrlMappingsHolder() @return The UrlMappingsHolder bean |
java.lang.Object |
mapURI(java.lang.String uri) Maps a URI and returns the appropriate controller instance |
UrlMappingsHolder |
mockUrlMappings(java.lang.Class urlMappingsClass) Mocks specific URL mappings class |
Methods inherited from class | Name |
---|---|
class ControllerUnitTestMixin |
createAndEnhance, getFlash, getGroovyPages, getModel, getParams, getRequest, getResponse, getServletContext, getSession, getStatus, getView, getViews, getWebRequest, mockCommandObject, mockController, testFor |
class GrailsUnitTestMixin |
defineBeans, getApplicationContext, getConfig, getGrailsApplication, getMainContext, getMessageSource, mockCodec, mockFor, mockForConstraintsTests, shouldFail, shouldFail |
class TestMixinRuntimeSupport |
getFeatures, getRuntime, setRuntime, setTestClass |
class groovy.lang.GroovyObjectSupport |
groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll() |
Asserts an action exists for the specified controller name, action name and url
controller
- The controller nameaction
- The action nameurl
- The URLasserts a controller exists for the specified name and url
controller
- The controller nameurl
- The urlAsserts the given controller and action produce the given reverse URL mapping
assertReverseUrlMapping("/action1", controller: "grailsUrlMappingsTestCaseFake", action: "action1")
assertions
- The assertions as named parametersurl
- The URL as a stringAsserts the given controller and action produce the given reverse URL mapping
assertReverseUrlMapping("/action1", controller: "grailsUrlMappingsTestCaseFake", action: "action1")
assertions
- The assertions as named parametersurl
- The URL as a stringparamAssertions
- The parameters to assert defined in the body of the closureAsserts a URL mapping maps to the controller and action specified by named parameters. Example:
assertUrlMapping("/action1", controller: "grailsUrlMappingsTestCaseFake", action: "action1")
assertions
- The assertions as named parametersurl
- The URL as a stringAsserts a URL mapping maps to the controller and action specified by named parameters. Example:
assertUrlMapping("/action1", controller: "grailsUrlMappingsTestCaseFake", action: "action1")
assertions
- The assertions as named parametersurl
- The URL as a stringparamAssertions
- The parameters to assert defined in the body of the closureAsserts a view exists for the specified controller name, view name and url
controller
- The controller nameview
- The view nameurl
- The url
Maps a URI and returns the appropriate controller instance
uri
- The URI to mapMocks specific URL mappings class
urlMappingsClass
- The URL mappings class to mock