Skip to content

Tests build fails because of WebTestClientAutoConfiguration with Spring 4.0.0-M1 and WebMvcTest #46678

@Germainch

Description

@Germainch

Hello, I just upgraded Spring Boot's version from 3.5.4 to 4.0.0-M1 in my project and tests build failed with this stack trace:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springBootWebTestClientBuilderCustomizer' defined in class path resource [org/springframework/boot/test/autoconfigure/web/reactive/WebTestClientAutoConfiguration.class]
.
.
.
Caused by: java.lang.TypeNotPresentException: Type org.springframework.boot.http.codec.CodecCustomizer not present

My dependencies:

  • spring-boot-starter-test
  • spring-boot-starter-webmvc
  • spring-boot-starter-security

I managed to bypass this error and by adding 'excludeAutoConfiguration = org.springframework.boot.test.autoconfigure.web.reactive.WebTestClientAutoConfiguration.class'
in my @WebMvcTest annotation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions