Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

@CheckReturnValue decoration for AssertJ's Assert implementations #32683

Open
Labels
Milestone
@scordio

Description

I suggest to decorate ApplicationContextAssert::getBean(s) methods with a @CheckReturnValue annotation so that incomplete statements like the following are spotted by static analysis tools like SpotBugs and IntelliJ IDEA:

assertThat(context).getBean(MyService.class);

To achieve this, no additional dependency is needed and Spring Boot Test can declare its own @CheckReturnValue annotation, similarly to what AssertJ and Mockito do.

I can raise a PR with the changes if the idea is accepted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /