wrdv / testme-idea

TestMe IntelliJ IDEA Plugin - Auto generates Unit Test code
http://weirddev.com/testme
Other
171 stars 65 forks source link

Undesired behavior of Mocking with <extends referenced class definitions> #51

Open Felps777 opened 2 months ago

Felps777 commented 2 months ago

I have a (Service layer class) ProviderVehicleImpl that extends from a BaseProviderImpl (which only contains Repository objects declarations to avoid to be done this on each extender class). I've notice the generated test, creates a MOCK for every defined Repo field there, even if they are not really used (instantiated) on ProviderVehicleImpl class. Considering we have a lot of repo definitions, this make the process take a lot of time to finished the tests, and at the final put a lot of Mock references that are useless in this class. Could this be considered a issue by you ?

yaronyam commented 2 months ago

interesting use case... thanks for raising this. there's a cool feature contributed lately by @huangliang992 & extended by @zhangfj88 that supports inherited class mock selection before test generation. feature needs to be enabled via IDEA Settings -> TestMe -> "Open Customization dialog before test generation". hope it can be handy here

Felps777 commented 2 months ago

Oh great, 😄 thank you very much.

have a nice day.


De: Yaron @.> Enviado: domingo, 22 de septiembre de 2024 21:38 Para: wrdv/testme-idea @.> Cc: felps777 @.>; Author @.> Asunto: Re: [wrdv/testme-idea] Undesired behavior of Mocking with (Issue #51)

interesting use case... thanks for raising this. there's a cool feature contributed lately by @huangliang992https://github.com/huangliang992 & extended by @zhangfj88https://github.com/zhangfj88 that supports inherited class mock selection before test generation. feature needs to be enabled via IDEA Settings -> TestMe -> "Open Customization dialog before test generation". hope it can be handy here

— Reply to this email directly, view it on GitHubhttps://github.com/wrdv/testme-idea/issues/51#issuecomment-2366933280, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABUOHYNAX4F7NWC2C7EQQ73ZX4MCTAVCNFSM6AAAAABOSLQSU2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRWHEZTGMRYGA. You are receiving this because you authored the thread.Message ID: @.***>