-
Notifications
You must be signed in to change notification settings - Fork 354
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
How do I simply exclude method from class #1360
Comments
The excludedMethods parameter is designed to exclude all methods matching a given glob. It does not match against the class name containing it, so "io.MyClass::" guarantees nothing will ever match. To exclude specific methods you have three options.
|
That annotation lives somewhere in the public API of pitest? Or should the user define his annotation (i.e., DoNotMutate, CoverageIgnore or Generated) and use it inside the code? |
Any annotation with correct name (and retention) will work. You can use https://mvnrepository.com/artifact/com.arcmutate/pitest-annotations/1.3.3 If you don't wish to define your own. |
Yes, that looks to be an issue. I'll see if I can take a look for the next release. |
Hmmm, maybe you can point me to what should be changed (of some radius where to find such a problem) and I can help. |
Contributions are always welcome. The logic here Line 42 in f9c3553
Needs to be expanded so that, instead of just scanning for directly annotated methods, the code compiles a list of annotated methods in one scan, then extracts a list of lambdas etc based on those names in a 2nd scan. Complications to consider include
|
After implementing [1] I tested with the source I posted above. Such an issue is resolved. Let me know what you think about that and if I forgot something... [1] - #1362 |
Closing this issue as #1362 is completed. |
Hello, how can one configure within the JUnit5 plugin exclusion of the specific method? Imagine simple example:
and dummy tests, which does nothing (expected) because we want to exclude such method.
Now when I run Pitest with the default configuration I get
which is fine because I didn't exclude any method yet. But now when I add to the plugin configuration
nothing really changed. I tried various stuff:
/
with `/My question is that possible to simply exclude a method? Because this is really great use case when you have a class where logic is basically mainly tasted on the Integration level and not the Unit level. I tried the same with the this works well without any problems. Thanks for the quick answer.
The text was updated successfully, but these errors were encountered: