google / error-prone

Catch common Java mistakes as compile-time errors
https://errorprone.info
Apache License 2.0
6.86k stars 744 forks source link

[Feature Request] Add check warning against mocking record types #4388

Open ralstonba opened 6 months ago

ralstonba commented 6 months ago

Records are typically used as simple wrappers of data without any methods or complex behavior requiring external dependencies or expensive IO operations. As such, they should (almost) never be mocked, and instead a real instance should be used instead.

ralstonba commented 6 months ago

I believe this PR addresses the FR: https://github.com/google/error-prone/pull/4384