@groovy.transform.Trait trait UrlMappingsUnitTest<T> extends java.lang.Object implements GrailsWebUnitTest, ParameterizedGrailsUnitTest<T>
Modifiers | Name | Description |
---|---|---|
static java.lang.String |
KEY_EXCEPTION |
|
private java.util.List<java.lang.String> |
assertionKeys |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
assertAction(java.lang.String controller, java.lang.String action) Asserts an action exists for the specified controller name, action name and url |
|
void |
assertController(java.lang.String controller) asserts a controller exists for the specified name and url |
|
void |
assertForwardUrlMapping(java.util.Map<java.lang.String, java.lang.Object> assertions, java.lang.Object url, groovy.lang.Closure paramAssertions) |
|
void |
assertReverseUrlMapping(java.util.Map<java.lang.String, java.lang.String> assertions, java.lang.String url, groovy.lang.Closure paramAssertions) Asserts the given controller and action produce the given reverse URL mapping |
|
void |
assertUrlMapping(java.util.Map<java.lang.String, java.lang.String> assertions, java.lang.String url, groovy.lang.Closure paramAssertions) Asserts a URL mapping maps to the specified controller, action, and optionally also parameters. |
|
void |
assertView(java.lang.String controller, java.lang.String view) Asserts a view exists for the specified controller name and view name |
|
private boolean |
checkAction(java.lang.String controller, java.lang.String action, boolean throwEx) |
|
private boolean |
checkController(java.lang.String controller, boolean throwEx) |
|
private boolean |
checkForwardUrlMapping(java.util.Map<java.lang.String, java.lang.Object> assertions, java.lang.Object url, groovy.lang.Closure paramAssertions, boolean throwEx) |
|
private boolean |
checkReverseUrlMapping(java.util.Map<java.lang.String, java.lang.String> assertions, java.lang.String url, groovy.lang.Closure paramAssertions, boolean throwEx) |
|
private boolean |
checkView(java.lang.String controller, java.lang.String view, boolean throwEx) |
|
void |
configuredMockedControllers() |
|
java.lang.String |
getBeanName(java.lang.Class<?> urlMappingsClass) |
|
GrailsControllerClass |
getControllerClass(java.lang.String controller) |
|
java.lang.Class[] |
getControllersToMock() |
|
UrlMappingsHolder |
getUrlMappingsHolder()
|
|
java.lang.Object |
mapURI(java.lang.String uri) Maps a URI and returns the appropriate controller instance |
|
void |
mockArtefact(java.lang.Class<?> urlMappingsClass) |
|
boolean |
verifyAction(java.lang.String controller, java.lang.String action)
|
|
boolean |
verifyController(java.lang.String controller)
|
|
boolean |
verifyForwardUrlMapping(java.util.Map<java.lang.String, java.lang.Object> assertions, java.lang.Object url, groovy.lang.Closure paramAssertions) |
|
boolean |
verifyReverseUrlMapping(java.util.Map<java.lang.String, java.lang.String> assertions, java.lang.String url, groovy.lang.Closure paramAssertions) Asserts the given controller and action produce the given reverse URL mapping |
|
boolean |
verifyUrlMapping(java.util.Map<java.lang.String, java.lang.String> assertions, java.lang.String url, groovy.lang.Closure paramAssertions) Verifies a URL mapping maps to the specified controller, action, and optionally also parameters. |
|
boolean |
verifyView(java.lang.String controller, java.lang.String view)
|
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() |
Asserts an action exists for the specified controller name, action name and url
controller
- The controller nameaction
- The action nameasserts 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 stringparamAssertions
- The parameters to assert defined in the body of the closureAsserts a URL mapping maps to the specified controller, action, and optionally also parameters. Example:
assertUrlMapping("/action1", controller: "grailsUrlMappingsTestCaseFake", action: "action1") {
param1 = "value1"
param2 = "value2"
}
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 and view name
controller
- The controller nameview
- The view name
Maps a URI and returns the appropriate controller instance
uri
- The URI to map
controller
- The controller nameaction
- The action name
controller
- The controller nameurl
- The urlAsserts the given controller and action produce the given reverse URL mapping
verifyReverseUrlMapping("/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 closureVerifies a URL mapping maps to the specified controller, action, and optionally also parameters. Example:
verifyUrlMapping("/action1", controller: "grailsUrlMappingsTestCaseFake", action: "action1") {
param1 = "value1"
param2 = "value2"
}
assertions
- The assertions as named parametersurl
- The URL as a stringparamAssertions
- The parameters to assert defined in the body of the closure
controller
- The controller nameview
- The view nameurl
- The url