[undertow-dev] Is HttpServerExchange should really be final?

Ilya Karpov i.karpov at cleverdata.ru
Tue Jun 16 07:04:08 EDT 2015


Hi, guys,
I'm facing problem of mocking HttpServerExchange via Mockito which fails 
because HttpServerExchange is marked as final. This is a bit 
disappointing and forces me to use other testing framework(e.g. PowerMock).
I've never seen situation where one must use final on class, and many 
situations where it was removed. For example, last time in aerospike 
client code:
BEFORE (watch final method - client can't be mocked)
https://github.com/aerospike/aerospike-client-java/blob/2.1.0/client/src/com/aerospike/client/AerospikeClient.java

AFTER(now final methods are still in place BUT class now implements 
interface I AerospikeClient - client methods now can be mocked via 
mocking interface)
https://github.com/aerospike/aerospike-client-java/blob/3.1.2/client/src/com/aerospike/client/AerospikeClient.java

Can you explain what are the reasons to use final here? May be remove 
final or switch to interface?
-- 
*Ilya Karpov*
Developer

CleverDATA
make your data clever
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20150616/91b41729/attachment.html 


More information about the undertow-dev mailing list