google / google/truth

Adding ClassSubject#isAnnotatedWith(Class)

Open
#139 6 comments 0 reactions 0 assignees View on GitHub
P3 type=addition
Dominant language
Java
Stars
2.8k
Forks
275
Avg merge
7m
Merged PRs (30d)
4

Description

How does Truth feel about adding things to ClassSubject?

There are assertions that I'd like to make using reflection (e.g. `assertThat(someClass).isAnnotatedWith(Singleton.class);`) that aren't currently supported without custom subjects. Is there any strong feeling for or against adding at least this assertion?

I haven't thought very deeply about inheritance, and there are probably arguments to be made in that area. If there isn't any opposition, I'll fork and get to work on it.

Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.