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

WebMvcTest and WebFluxTest ignore user-provided Thymeleaf IDialect beans #24149

Closed
jnizet opened this issue Nov 13, 2020 · 6 comments
Closed

WebMvcTest and WebFluxTest ignore user-provided Thymeleaf IDialect beans #24149

jnizet opened this issue Nov 13, 2020 · 6 comments
Assignees
Milestone

Comments

@jnizet
Copy link
Contributor

@jnizet jnizet commented Nov 13, 2020

Beans implementing Thymeleaf's IDialect interface are automatically registered by Spring Boot as dialects for Thymeleaf templates.
But this doesn't happen in WebMvcTests, where IDialect beans are not included. It seems to me that they belong to the web MVC layer, and should thus be added to the WebMvcTest slice.

The workaround is of course easy enough:

@Import(MyCustomDialect.class)
@wilkinsona
Copy link
Member

@wilkinsona wilkinsona commented Nov 13, 2020

Thanks, @jnizet. This feels like a bug to me. It doesn't really make sense to include an auto-configuration while excluding user-provided beans that it would normally consume.

@wilkinsona wilkinsona changed the title Consider adding Thymeleaf IDialect beans to WebMvcTest slice WebMvcTest ignores user-provided Thymeleaf IDialect beans Nov 13, 2020
@wilkinsona wilkinsona added this to the 2.2.x milestone Nov 13, 2020
@sadath42
Copy link

@sadath42 sadath42 commented Dec 6, 2020

Hi @wilkinsona is this bug available to work , I would be interested to work on it.

@wilkinsona
Copy link
Member

@wilkinsona wilkinsona commented Dec 7, 2020

@sadath42 Thanks for the offer. A contribution that fixes this would be much appreciated. Please let us know if you have any questions.

@sadath42
Copy link

@sadath42 sadath42 commented Dec 14, 2020

@wilkinsona No questions as if now. I am analyzing the bug if there any questions will let you know .

@philwebb philwebb modified the milestones: 2.2.x, 2.3.x Dec 16, 2020
@wilkinsona
Copy link
Member

@wilkinsona wilkinsona commented Feb 1, 2021

How's it going, @sadath42? It's been a while now. If you no longer have time to work on a fix, please just let us know and we can take care of it. Equally, please let us know if you have any questions.

@sadath42
Copy link

@sadath42 sadath42 commented Feb 1, 2021

Hi ,
Please assign it someone else.

@wilkinsona wilkinsona assigned wilkinsona and unassigned sadath42 Feb 1, 2021
@wilkinsona wilkinsona changed the title WebMvcTest ignores user-provided Thymeleaf IDialect beans WebMvcTest and WebFluxTest ignore user-provided Thymeleaf IDialect beans Feb 1, 2021
@wilkinsona wilkinsona modified the milestones: 2.3.x, 2.3.9 Feb 1, 2021
@wilkinsona wilkinsona closed this in 3585d20 Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants