Skip to content

JUnit ExpectedException is deprecated #7467

@ejona86

Description

@ejona86

In JUnit 4.13 ExpectedException is deprecated. The replacement, assertThrows, is Java 8-centric and would be annoying to use in the short-term. Using try+fail would increase boilerplate and would be worse than just using ExpectedException.

We can @SuppressWarnings for now, but we should swap to assertThrows (or Truth's variant) in the future once we can use Java 8 in our tests.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions