Mocking SQLStatement

178 views
Skip to first unread message

Andrew

unread,
Apr 9, 2013, 6:43:49 PM4/9/13
to jd...@googlegroups.com
Hi,

I've using jDBI with good success but recently ran into problems trying with unit tests. I want to verify bind method invocations on my Update statements but since the method is final it's not possible to mock with my mock framework (Mockito). I was just wondering if there was a reason for the final modifier and if not could it be considered for removal in a future release.

Andrew

Brian McCallister

unread,
Apr 12, 2013, 9:51:05 PM4/12/13
to jd...@googlegroups.com
I need to look up the binary backwards compatibility rules for removing the final modifier, but if it will remain binary compatible, I'd be happy to.

-Brian



Andrew

--
You received this message because you are subscribed to the Google Groups "jDBI" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jdbi+uns...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Christophe Furmaniak

unread,
Apr 23, 2013, 10:47:28 AM4/23/13
to jd...@googlegroups.com
Did you try to use something like PowerMock (https://code.google.com/p/powermock/) that should allow you to mock final stuff.

Andrew Rapp

unread,
Apr 23, 2013, 12:09:18 PM4/23/13
to jd...@googlegroups.com
I did but it was more efficient for me to create a delegate class for Update to solve the problem rather than introduce a new test framework


--
You received this message because you are subscribed to a topic in the Google Groups "jDBI" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jdbi/aUA897MqzAE/unsubscribe?hl=en-US.
To unsubscribe from this group and all its topics, send an email to jdbi+uns...@googlegroups.com.

Asaf David

unread,
Dec 9, 2013, 1:40:45 AM12/9/13
to jd...@googlegroups.com
can you shed some light on how you created this delegate class? i tried to go this way, but i can't extend Update as its c'tor isn't public
thanks
Reply all
Reply to author
Forward
0 new messages