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

Library doesn't work in @WebMvcTest #926

Open
remal opened this issue May 24, 2023 · 0 comments
Open

Library doesn't work in @WebMvcTest #926

remal opened this issue May 24, 2023 · 0 comments
Labels

Comments

@remal
Copy link

remal commented May 24, 2023

Description

I'd like to test that my exceptions and handled correctly and application/problem+json response is returned.

For that, I write tests annotated with @WebMvcTest.

Expected Behavior

Auto-configurations from org.zalando:problem-spring-web-autoconfigure are included in the test context.

Actual Behavior

Auto-configurations from org.zalando:problem-spring-web-autoconfigure are NOT included in the test context.

Possible Fix

Copy content of META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports into:

  • META-INF/spring/org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureWebMvc.imports - to support @WebMvcTest
  • META-INF/spring/org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebFlux.imports - to support @WebFluxTest
@remal remal added the Bug label May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant