File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
grails-plugin-testing/src/main/groovy/grails/test/mixin/web Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import org.grails.gsp.GroovyPagesTemplateEngine
3939 */
4040class UrlMappingsUnitTestMixin extends ControllerUnitTestMixin {
4141
42+ public static final String KEY_EXCEPTION = ' exception'
4243 private assertionKeys = [" controller" , " action" , " view" ]
4344
4445 /**
@@ -193,7 +194,12 @@ class UrlMappingsUnitTestMixin extends ControllerUnitTestMixin {
193194 def mappingInfos
194195 if (url instanceof Integer ) {
195196 mappingInfos = []
196- def mapping = mappingsHolder. matchStatusCode(url)
197+ def mapping
198+ if (assertions. " $KEY_EXCEPTION " ) {
199+ mapping = mappingsHolder. matchStatusCode(url, assertions. " $KEY_EXCEPTION " as Throwable )
200+ } else {
201+ mapping = mappingsHolder. matchStatusCode(url)
202+ }
197203 if (mapping) mappingInfos << mapping
198204 }
199205 else {
You can’t perform that action at this time.
0 commit comments