This is an automated email from the ASF dual-hosted git repository.

pgil pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 8cfdd8ebf3 Fixed: Fix Accounting Groovy tests (OFBIZ-12995)
8cfdd8ebf3 is described below

commit 8cfdd8ebf3f55bb20f68742ac95dc8d57d26a2ed
Author: Gil Portenseigne <gil.portensei...@nereide.fr>
AuthorDate: Fri Apr 5 11:51:59 2024 +0200

    Fixed: Fix Accounting Groovy tests (OFBIZ-12995)
    
    This fix the last remaining failing groovy integration tests.
    Fix bad groovy truth usage to test invoice creation.
    Simplify groovy syntax to get the max intervalQuantity from a list of
    GenericValue.
---
 .../ofbiz/accounting/accounting/InvoicePerShipmentTests.groovy    | 8 ++++----
 .../apache/ofbiz/accounting/fixedasset/FixedAssetServices.groovy  | 4 +---
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git 
a/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/accounting/InvoicePerShipmentTests.groovy
 
b/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/accounting/InvoicePerShipmentTests.groovy
index fc0821e649..b4baa323b3 100644
--- 
a/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/accounting/InvoicePerShipmentTests.groovy
+++ 
b/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/accounting/InvoicePerShipmentTests.groovy
@@ -46,7 +46,7 @@ class InvoicePerShipmentTests extends OFBizTestCase {
          Step 4) Check invoice should not created.
          */
         List invoices = testInvoicePerShipment('GZ-1000', 'N')
-        assert invoices
+        assert !invoices
     }
 
     void testInvoicePerShipmentSetTrue() {
@@ -57,7 +57,7 @@ class InvoicePerShipmentTests extends OFBizTestCase {
          Step 4) Check invoice should be created.
          */
         List invoices = testInvoicePerShipment('GZ-1000', 'Y')
-        assert !invoices
+        assert invoices
     }
 
     void testInvoicePerShipmentSetOrderFalse() {
@@ -67,7 +67,7 @@ class InvoicePerShipmentTests extends OFBizTestCase {
          Step 3) Check invoice should not be created.
          */
         List invoices = testInvoicePerShipment('GZ-2644', 'N')
-        assert invoices
+        assert !invoices
     }
 
     void testInvoicePerShipmentSetOrderTrue() {
@@ -77,7 +77,7 @@ class InvoicePerShipmentTests extends OFBizTestCase {
          Step 3) Check invoice should be created.
          */
         List invoices = testInvoicePerShipment('GZ-2644', 'Y')
-        assert !invoices
+        assert invoices
     }
 
     private List testInvoicePerShipment(String productId, String 
invoicePerShipment) {
diff --git 
a/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/fixedasset/FixedAssetServices.groovy
 
b/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/fixedasset/FixedAssetServices.groovy
index cd594b5a29..6cf9e109a6 100644
--- 
a/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/fixedasset/FixedAssetServices.groovy
+++ 
b/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/fixedasset/FixedAssetServices.groovy
@@ -140,9 +140,7 @@ Map createMaintsFromMeterReading() {
                         .queryList()
                 long listSize = maintList ? maintList.size() : 0L
 
-                BigDecimal maxIntervalQty = maintList ? maintList
-                        .findAll { maint -> maint.intervalQuantity }
-                        .max() : 0
+                BigDecimal maxIntervalQty = maintList ? 
maintList*.intervalQuantity.max() : 0
 
                 BigDecimal nextIntervalQty = maxIntervalQty + 
p.intervalQuantity
                 if (parameters.meterValue &&

Reply via email to