zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anmolnar <...@git.apache.org>
Subject [GitHub] zookeeper pull request #652: ZOOKEEPER-3156: Add in option to canonicalize h...
Date Tue, 02 Oct 2018 12:55:41 GMT
Github user anmolnar commented on a diff in the pull request:

    --- Diff: src/java/main/org/apache/zookeeper/ClientCnxn.java ---
    @@ -793,7 +794,87 @@ public RWServerFoundException(String msg) {
    +    static class MockableInetSocketAddress {
    --- End diff --
    I agree. Unfortunately methods of `InetSocketAddress` and `InetAddress` are final and
cannot be mocked. There's a Mockito extension which could help, but it's quite recent and
an opt-in feature:
    Implementing wrapper classes is good approach, but I wouldn't put them into `ClientCnxn.java`.
I suggest creating a new file with wrapper classes (nit: renaming them to \*Wrapper instead
of Mockable\* would be better) and also put `getServerPrincipal()` into this file as well.


View raw message