Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UrlMappingsUnitTestMixin does not check exception mappings #10226

Closed
4 tasks done
joemccall86 opened this issue Oct 13, 2016 · 0 comments
Closed
4 tasks done

UrlMappingsUnitTestMixin does not check exception mappings #10226

joemccall86 opened this issue Oct 13, 2016 · 0 comments
Milestone

Comments

@joemccall86
Copy link
Contributor

By default the UrlMappingsUnitTestMixin does not perform a check against the type of exception inside UrlMappings.groovy. We currently sub-class UrlMappingsUnitTestMixin to test this feature, but I'd like to document its absence here.

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. Create an entry in UrlMappings.groovy mapping different actions for the '500' location based on the exception thrown
  2. Create unit test that uses the UrlMappingsTestMixin to test using assertForwardUrlMapping
  3. Observe the test failure

Expected Behaviour

assertForwardUrlMapping will test the exception mapping in UrlMappings.groovy

Actual Behaviour

assertForwardUrlMapping only tests the action/controller, ignoring the exception.

Environment Information

  • Operating System: Ubuntu MATE 16.10
  • Grails Version: 3.1.12
  • JDK Version: OpenJDK 64-Bit Server VM (build 25.102-b14, mixed mode)

Example Application

https://github.com/joemccall86/url-mappings-mixin-test

Other Notes

We have the workaround code already, and I'm putting together a PR to address this issue right now.

joemccall86 pushed a commit to joemccall86/grails-core that referenced this issue Oct 13, 2016
joemccall86 pushed a commit to joemccall86/grails-core that referenced this issue Oct 14, 2016
@graemerocher graemerocher added this to the grails-3.1.12 milestone Oct 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants