Skip to content

WebMvcTest and WebFluxTest do not include Jackson Module beans #22530

@jnizet

Description

@jnizet

The @JsonTest annotation automatically includes beans of type com.fasterxml.jackson.databind.Module.
So you can test that you've configured Jackson correctly by using a JsonTest, and it will automatically pick up your beans of type Module.

But as soon as you use an @WebMvcTest that relies on this Module bean, it fails because @WebMvcTest does not include beans of type com.fasterxml.jackson.databind.Module (although it does include beans annotated with @JsonComponent, just like @JsonTest).

This is easy enough to workaround, but it's surprising and inconsistent, IMHO.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions