[go: nahoru, domu]

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

Ensuring the conversion service can convert a value #205

Open
vrish88 opened this issue Jan 24, 2019 · 0 comments
Open

Ensuring the conversion service can convert a value #205

vrish88 opened this issue Jan 24, 2019 · 0 comments

Comments

@vrish88
Copy link
vrish88 commented Jan 24, 2019

Hello!

We are trying to figure out how to verify that we will be formatting a LocalDateTime appropriately in our Thymeleaf template. There is one approach that we would like feedback on. We would like to write as lightweight of a test as possible that would still give us the assurance that we are invoking Thymeleaf correctly to render the right text (using the ${{...}} syntax) and that we have the correct converters registered.

Here is the approach we would like feed back on: Write a mockMvc test that renders the page. If there is a conversion service registered to handle a LocalDateTime, the page renders fine. If there is no conversion service converter to handle a LocalDateTime then Thymleaf throws an exception.

Is there a way to configure Thymeleaf to do this? Unfortunately it appears that the SpringStandardConversionService won't allow this

Or is this configurable behavior that could be added to thymeleaf for testing purposes?

Thanks!

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

1 participant