Skip to content

Assertions.assertNotNull() should return the non-null object #4015

@garydgregory

Description

@garydgregory

As a developer, I like to write some test code like:

import static org.junit.jupiter.api.Assertions.assertNotNull;
...
Foo foo = assertNotNull(bar.doSomething()).getFoo();

Deliverables

  • An Assertions.assertNotNull() that returns its input and not void.
  • You could make the same argument for assertSame()

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions