Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

make i18n configurable #329

Merged
merged 5 commits into from
Jun 11, 2019
Merged

make i18n configurable #329

merged 5 commits into from
Jun 11, 2019

Conversation

MikeSafonov
Copy link
Contributor

See #318

@fbenz fbenz requested review from jmisur and fbenz May 23, 2019 13:01
@jmisur
Copy link
Contributor

jmisur commented May 27, 2019

Looks good however I would like to see how would you use it in your restdoc tests.
It would be nice if you can configure it using standard MockMvc way using alwaysDo(...) mechanism the same way we add Jackson ObjectMapper into test "context". See JacksonResultHandlers.

@MikeSafonov
Copy link
Contributor Author

I tried to do as you requested. Now translation possible to configure like this:

SnippetTranslationResolver translationResolver = ...
this.mockMvc = MockMvcBuilders
...
.alwaysDo(JacksonResultHandlers.prepareJackson(objectMapper, translationResolver))

or

SnippetTranslationResolver translationResolver = ...
this.mockMvc = MockMvcBuilders
...
.alwaysDo(TranslationHandlers.translation(translationResolver))

Copy link
Contributor

@fbenz fbenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution. It looks good now.

@MikeSafonov
Copy link
Contributor Author

I have added ability to override constraint descriptions. Check it please

Copy link
Contributor

@jmisur jmisur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
There are some formatting changes but we'll fix it later
Thanks

@jmisur jmisur merged commit 751cfe7 into ScaCap:master Jun 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants