Skip to content
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

Is there a way to not have annotations lower test coverage? #1102

Closed
dabraham02124 opened this issue May 5, 2016 · 2 comments
Closed

Is there a way to not have annotations lower test coverage? #1102

dabraham02124 opened this issue May 5, 2016 · 2 comments

Comments

@dabraham02124
Copy link

I'm sure that lombok itself is extensively tested. But I'm running coverage tools on my application which uses lombok extensively, and a lot of my classes are reporting coverage of 70% or so, even though every line of the code I wrote is covered (per Emma).

For instance, I frequently use @value mostly for the getters, constructor, and private final. I'm glad that equals, toString, & hashCode are there in case I need them, but I'm frequently not using them, much less testing them.

The simple answer is lots of boilerplate where I have a thing that runs all of the lombok functionality for a given class (I'd trust the tests on lombok itself to do the actual testing). But adding boilerplate due to lombok seems wrong.

My first thought is an annotation to be placed on a test class. Something like:
@LombokTest(class=Foo.class) public class FooTest { /* some methods that test the code I wrote */ }

The annotation would investigate class Foo, see what lombok has added, then run those methods, thus letting my coverage report more or less reflect the coverage of my code). I'm sure that there are better ways, but this is what I came up with.

Again thank you for lombok. It makes my life distinctly easier.

@Maaartinus
Copy link
Contributor

Duplicate of issue 1014.

I'm afraid, there's no solution for tools working on class files (because of the retention of @javax.annotation.Generated and because of @lombok.Generated not used yet).

@dabraham02124
Copy link
Author

Interesting. So I'm late to an ongoing project. Googling around I only found this, and this (oddly enough googling on "lombok generated annotation" turns up a lot of false positives. Is there a discussion of when this is happening, and what we'll have to do to work with it?

Again, thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants