Hi team,
I'm surprised I haven't found this one raised before, maybe it's just my OCD or I am missing something.
@TestOnly is great, but is not enough I believe as a common (maybe not perfect) pattern is increasing visibility of a method to make it reachable for tests while it is still actually used in production.
You can argue that you shouldn't have such methods, but than there shouldn't be TestOnly methods either.
I believe we either need a new annotation only applying to visibility, or if it feels more natural add some property to the TestOnly to indicate that it only applies to visibility. Having said that I believe it'd be too verbose and is probably more restricting in future.
Maybe this has been discussed before and ruled out for some reason, I'd love to hear the reasoning, but I feed strongly that it is just missing and would be a great benefit if it existed.
Thank you,
Sergey
Hi team, I'm surprised I haven't found this one raised before, maybe it's just my OCD or I am missing something. @TestOnly is great, but is not enough I believe as a common (maybe not perfect) pattern is increasing visibility of a method to make it reachable for tests while it is still actually used in production. You can argue that you shouldn't have such methods, but than there shouldn't be TestOnly methods either. I believe we either need a new annotation only applying to visibility, or if it feels more natural add some property to the TestOnly to indicate that it only applies to visibility. Having said that I believe it'd be too verbose and is probably more restricting in future. Maybe this has been discussed before and ruled out for some reason, I'd love to hear the reasoning, but I feed strongly that it is just missing and would be a great benefit if it existed. Thank you, Sergey