-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding ClassSubject#isAnnotatedWith(Class) #139
Comments
Added it to our API review for today...thanks! |
Sorry - we didn't get to it in API review this week. But at a high level, I On Tue, Oct 7, 2014, 08:09 Kurt Alfred Kluever notifications@github.com
|
No worries. Would it be better to defer work on this until after it is addressed in review? |
@benjamin-bader Yep - let's hold off until it's greenlit @ API review. Thanks! |
Looks like we never ended up discussing this, but I think we'd like to hear a bit more about the use-case you had in mind? |
Sure. The impetus for me was writing some Jersey Since then, I've been playing around with generated classes and wishing to ensure that they have the expected annotations, but that's a decidedly more unusual case (for me, at least). The important point to me is that there are cases where a missing or incorrect annotation will cause incorrect behavior at runtime, but whose absence/misuse will not be caught by the compiler - therefore requiring test coverage. |
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!
The text was updated successfully, but these errors were encountered: