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

Add RegisterDefaultExceptionMappers to TestRule #1387

Merged
merged 1 commit into from Dec 16, 2015

Conversation

Projects
None yet
3 participants
@nickbabcock
Contributor

nickbabcock commented Dec 15, 2015

This commit makes the default behavior of ResourceTestRule to register
all the default exception mappers, much like how the default yaml
configuration will register the default exception mappers.

If a user wants to override the default exception mappers, then they can
call setRegisterDefaultExceptionMappers(false) and subsequently register
their custom exception mappers.

Note that this is breaking behavior as those who registered their
exception mappers will now have to call setRegisterDefaultExceptionMappers
and those who wanted the default exception mappers should now remove their
registrations of the default exception mappers.

The reason behind this pull request is that, in my opinion, it is unreasonable
for someone new to Dropwizard to know all the default exception mappers that
they will need to register in ResourceTestRule to get the same behavior as their
app.

Add RegisterDefaultExceptionMappers to TestRule
This commit makes the default behavior of `ResourceTestRule` to register
all the default exception mappers, much like how the default yaml
configuration will register the default exception mappers.

If a user wants to override the default exception mappers, then they can
call `setRegisterDefaultExceptionMappers(false)` and subsequently register
their custom exception mappers.

Note that this is breaking behavior as those who registered their
exception mappers will now have to call setRegisterDefaultExceptionMappers
and those who wanted the default exception mappers should now remove their
registrations of the default exception mappers.

@jplock jplock added this to the 1.0.0 milestone Dec 15, 2015

@jplock jplock added the improvement label Dec 15, 2015

@arteam

This comment has been minimized.

Show comment
Hide comment
@arteam

arteam Dec 16, 2015

Member

LGTM. I think this is a step in the right direction, because testing environment should closely resemble production.

Member

arteam commented Dec 16, 2015

LGTM. I think this is a step in the right direction, because testing environment should closely resemble production.

arteam added a commit that referenced this pull request Dec 16, 2015

Merge pull request #1387 from nickbabcock/test-register-exception-map…
…pers

Add RegisterDefaultExceptionMappers to TestRule

@arteam arteam merged commit b602447 into dropwizard:master Dec 16, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment