From notifications-return-1484-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Fri Aug 16 13:25:04 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9E94C18057A for ; Fri, 16 Aug 2019 15:25:04 +0200 (CEST) Received: (qmail 46585 invoked by uid 500); 16 Aug 2019 13:25:04 -0000 Mailing-List: contact notifications-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list notifications@zookeeper.apache.org Received: (qmail 46574 invoked by uid 99); 16 Aug 2019 13:25:04 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Aug 2019 13:25:04 +0000 From: GitBox To: notifications@zookeeper.apache.org Subject: [GitHub] [zookeeper] anmolnar commented on issue #1056: ZOOKEEPER-3495: fix SnapshotDigestTest to work with JDK12+ Message-ID: <156596190404.21334.2343587777779735934.gitbox@gitbox.apache.org> Date: Fri, 16 Aug 2019 13:25:04 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit anmolnar commented on issue #1056: ZOOKEEPER-3495: fix SnapshotDigestTest to work with JDK12+ URL: https://github.com/apache/zookeeper/pull/1056#issuecomment-522007704 I think this code is not perfectly organised: 1. `DigestCalculator` is a dependency of `DataTree`, so it should be moved to the same package and all members can be package-private which makes them unaccessible from outside, 2. We can introduce a public interface making interface members public and letting unit tests mocking without reflection. 3. `DataTree` constructor can be overloaded with one which will get `DigestCalculator` interface as a dependency, so the entire static approach can be removed. Tests can use the new constructor to inject the mocked version of the Calculator this way. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services