Now using an injected internal converter mock, the coverage goes green. But for an injected match mock still the match.SetChanged verification was not covered, so I comment it. And the weirdest part was the return line not being covered!? How is that possible?
I have the corresponding tests for true/false expectations. And the canConvertMatch is correctly checked.
I'm running PIT 1.1.11, powermock 1.6.6 and mockito 1.10.19.
I would appreciate any feedback as I really like PIT and am trying to get it running in my company, but with the wrong coverage in such cases it gets difficult... A lot of legacy code which makes extensive use of the more advanced features of powermock.
Thanks!
Best regards,
Richard
--
You received this message because you are subscribed to the Google Groups "PIT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pitusers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "PIT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pitusers/bKsfZqiBbos/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pitusers+unsubscribe@googlegroups.com.
Hi Henry,Any news?Thanks!Cheers,Richard
On Tue, Mar 7, 2017 at 8:43 PM, Richard Sassoon <> wrote:
Hi Henry,That would be awesome. Please take a look at https://github.com/rsassoon/pit_powermock_exampleLet me know if there is anything I can help with.Thanks a lot!Cheers,Richard
On Tue, Mar 7, 2017 at 4:02 PM, 'Henry Coles' via PIT Users <> wrote:
HenryIf you can put together a minimal project that reproduces the issue I can take a look and see what's going on.Hi Richard,It's a long time since I implemented powermock support for PIT and I'm afraid I've forgotten the details of what powermock does behind the scenes.
On 6 March 2017 at 19:57, Richard Sassoon <> wrote:Hi all,--I'm having a hard time making PIT work correctly when using PowerMock. It seems that too much byte code manipulation causes strange coverage issues.In the above example my tests contain calls to PowerMockito.whenNew operator for the internal collaborator returning a MatchConverter mock, and a mockStatic for the static MatchSearchDao.findMatchById method where Match is returned as a mock.The converter.convert is correctly stubbed. The match.setChanged is correctly verified. And all the unit tests pass without problems checking the corresponding value for matchChanged as the return.I tried then adding a different method implementation and got this:
Now using an injected internal converter mock, the coverage goes green. But for an injected match mock still the match.SetChanged verification was not covered, so I comment it. And the weirdest part was the return line not being covered!? How is that possible?
I have the corresponding tests for true/false expectations. And the canConvertMatch is correctly checked.
I'm running PIT 1.1.11, powermock 1.6.6 and mockito 1.10.19.
I would appreciate any feedback as I really like PIT and am trying to get it running in my company, but with the wrong coverage in such cases it gets difficult... A lot of legacy code which makes extensive use of the more advanced features of powermock.
Thanks!
Best regards,
Richard
You received this message because you are subscribed to the Google Groups "PIT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pitusers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.