<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Sorry for the delay. A number of us were traveling when you sent it.</div><div><br></div><div>The reason the class is final is just following the common practice of explicitly disallowing inheritance unless the class is explicitly designed for it. The rationale behind the practice is that a class that allows inheritance essentially has a fixed implementation that can not evolve without potentially breaking compatibility. Additionally if the class has concurrency behavior, inheritance that is not designed around an explicit synchronization contract can lead to all kinds of bugs.</div><div><br></div><div>If you do want to use mock testing, there are frameworks like easymock which can generate proxies for you, and your test code stays quite clean.&nbsp;</div><div><br></div><div>On Oct 17, 2015, at 9:40 AM, Greg Hellings &lt;<a href="mailto:greg.hellings@gmail.com">greg.hellings@gmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><p dir="ltr">Ping.</p>
<p dir="ltr">--Greg</p>
<div class="gmail_quote">On Oct 8, 2015 11:41 AM, "Greg Hellings" &lt;<a href="mailto:greg.hellings@gmail.com">greg.hellings@gmail.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm trying to mock out the HttpServerExchange object in my tests, but<br>
I apparently cannot do so because the class is declared final. Why is<br>
it final? Does that give Undertow anything beneficial?<br>
<br>
If there's good reason to not remove the final, I can just wrap the<br>
object in a proxy class that's not final, but I'd rather not do that<br>
just to get around limitations in mocking. Another alternative would<br>
be for me to skip unit tests on the handler methods and leverage<br>
integration tests.But there are sometimes bits of logic in the handler<br>
that I want to Unit Test directly.<br>
<br>
Any help would be appreciated.<br>
<br>
--Greg<br>
</blockquote></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>undertow-dev mailing list</span><br><span><a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a></span><br><span><a href="https://lists.jboss.org/mailman/listinfo/undertow-dev">https://lists.jboss.org/mailman/listinfo/undertow-dev</a></span></div></blockquote></body></html>