Skip to content

Prevent compilation error with WebTestClient without Hamcrest #35666

@sdeleuze

Description

@sdeleuze

As reported by @wilkinsona, when Hamcrest is not in the classpath, there is currently a compilation error:

> Compilation failed; see the compiler output below.
  /Users/aw036093/.gradle/caches/modules-2/files-2.1/org.springframework/spring-test/7.0.0-RC1/fcca771c85c3e98a9cd498bc1e920dd10e0d3c48/spring-test-7.0.0-RC1.jar(/org/springframework/test/web/reactive/server/WebTestClient$BodySpec.class): error: Cannot attach type annotations @org.jspecify.annotations.Nullable to BodySpec.value:
    class file for org.hamcrest.Matcher not found
  1 error

The JDK may be refined to be more lenient for such use cases, but in the meantime we should explore if we can find a way to avoid this warning.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions