From commits-return-10619-archive-asf-public=cust-asf.ponee.io@fineract.apache.org Tue Jun 23 11:09:53 2020 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 040061804BB for ; Tue, 23 Jun 2020 13:09:52 +0200 (CEST) Received: (qmail 28388 invoked by uid 500); 23 Jun 2020 11:09:52 -0000 Mailing-List: contact commits-help@fineract.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@fineract.apache.org Delivered-To: mailing list commits@fineract.apache.org Received: (qmail 28379 invoked by uid 99); 23 Jun 2020 11:09:52 -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; Tue, 23 Jun 2020 11:09:52 +0000 From: =?utf-8?q?GitBox?= To: commits@fineract.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bfineract=5D_thesmallstar_commented_on_pull_request?= =?utf-8?q?_=231100=3A_FINERACT-1047_Integration_test_for_Audit_trails=28Cre?= =?utf-8?q?ate=29?= Message-ID: <159291059227.8807.13902764788773415381.asfpy@gitbox.apache.org> Date: Tue, 23 Jun 2020 11:09:52 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In-Reply-To: References: thesmallstar commented on pull request #1100: URL: https://github.com/apache/fineract/pull/1100#issuecomment-648076591 @vorburger I was a little worried about this approach though and thought of changing this to something more robust. The problem: We are checking count for the entries like this: Get me the count of audit trails whose resource-id is x it was activated and is of type client. Here, the same event can occur twice and hence two audits will be returned, which does not necessarily mean that the test failed(since we are checking count to be equal to one) The solution: Calculate the count before the action(create, update, activate) and check if count incremented by one, after the action. Why the old approach is still correct? Two reasons: Every entity is created for the first time, no action is performed twice. Just that I thought it was fundamentally wrong to check count to be one(not a general case), I hope I am not too confusing. Which approach will you prefer? ---------------------------------------------------------------- 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