wrdv / testme-idea

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

when "Declare exceptions thrown by tested class" setting is on - test code exceptions should be taken into account #32

Closed yaronyam closed 7 months ago

yaronyam commented 7 months ago

When Setting "Declare exceptions thrown by tested class" is set and no exception declared by tested method - still need to consider exceptions declared by test code methods For instance, this Powermock SDK method - org.powermock.api.mockito.expectation.PowerMockitoStubber#when(T, java.lang.String, java.lang.Object...) - declares an exception

image

can be tested with com.weirddev.testme.intellij.generator.TestMeGeneratorJunit4PowerMockTest#testRenderInternalMethodCallStubs we probably need to add some logic in Mock builder to decide if throws Exception should be declared even though tested method does not.

related to https://github.com/wrdv/testme-idea/pull/29 FYI @zhangfj88

zhangfj88 commented 7 months ago

Thank you for raising the issue and suggestions regarding this feature. I will submit the revised code accordingly.

yaronyam commented 6 months ago

Fixed in #34. Released in V6.4.1 Thanks again for fixing this @zhangfj88