On the service calcShipmentCostEstimate, each estimated shipment cost is analysed to resolve which ones should be applied on the order. During the breakQtys block analysis, OFBiz checks if the estimate match the quantity with their breaks and validates if one is good. If a rule contains multiple break type (ex: weight and price) this will be ignored or use as partial, only one break would be analysed. To solve it we extend the analyse on the break type combinaison. After a global code review, we reformat the function to down less code quantity for help the reader on: * use an Util function to resolve BigDecimal values * dedicate function to resolve the shipping address * dedicate function to validate a break type * move multiple loop to stream Thanks to Gil Portenseigne and Jacques Leroux for their look
52 lines
2.1 KiB
XML
52 lines
2.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!--
|
|
Licensed to the Apache Software Foundation (ASF) under one
|
|
or more contributor license agreements. See the NOTICE file
|
|
distributed with this work for additional information
|
|
regarding copyright ownership. The ASF licenses this file
|
|
to you under the Apache License, Version 2.0 (the
|
|
"License"); you may not use this file except in compliance
|
|
with the License. You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing,
|
|
software distributed under the License is distributed on an
|
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, either express or implied. See the License for the
|
|
specific language governing permissions and limitations
|
|
under the License.
|
|
-->
|
|
|
|
<test-suite suite-name="facilitytests"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/test-suite.xsd">
|
|
<test-case case-name="stockMove-test">
|
|
<junit-test-suite class-name="org.apache.ofbiz.product.test.StockMovesTest"/>
|
|
</test-case>
|
|
<test-case case-name="inventoryItemTransfer-test">
|
|
<junit-test-suite class-name="org.apache.ofbiz.product.test.InventoryItemTransferTest"/>
|
|
</test-case>
|
|
<test-case case-name="inventory-tests">
|
|
<junit-test-suite class-name="org.apache.ofbiz.product.InventoryTests"/>
|
|
</test-case>
|
|
|
|
<test-case case-name="shipment-tests">
|
|
<junit-test-suite class-name="org.apache.ofbiz.product.ShipmentTests"/>
|
|
</test-case>
|
|
|
|
<test-group case-name="shipmentcost-tests">
|
|
<entity-xml action="load" entity-xml-url="component://product/testdef/data/ShipmentCostTestData.xml"/>
|
|
<junit-test-suite class-name="org.apache.ofbiz.shipment.ShipmentCostTests"/>
|
|
</test-group>
|
|
|
|
<test-case case-name="loadIssuanceTestData">
|
|
<entity-xml action="load" entity-xml-url="component://product/testdef/data/IssuanceTestData.xml"/>
|
|
</test-case>
|
|
|
|
<test-case case-name="issuance-tests">
|
|
<junit-test-suite class-name="org.apache.ofbiz.shipment.test.IssuanceTest"/>
|
|
</test-case>
|
|
|
|
</test-suite>
|