svn commit: r1818431 - in /ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/test: PurchaseOrderTest.java SalesOrderTest.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1818431 - in /ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/test: PurchaseOrderTest.java SalesOrderTest.java

mbrohl
Author: mbrohl
Date: Sat Dec 16 16:03:08 2017
New Revision: 1818431

URL: http://svn.apache.org/viewvc?rev=1818431&view=rev
Log:
Improved: General refactoring and code improvements, package
org.apache.ofbiz.order.test.
(OFBIZ-10063)

Thanks Julian Leichert for reporting and providing the patches.

Modified:
    ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/test/PurchaseOrderTest.java
    ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/test/SalesOrderTest.java

Modified: ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/test/PurchaseOrderTest.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/test/PurchaseOrderTest.java?rev=1818431&r1=1818430&r2=1818431&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/test/PurchaseOrderTest.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/test/PurchaseOrderTest.java Sat Dec 16 16:03:08 2017
@@ -49,7 +49,7 @@ public class PurchaseOrderTest extends O
     }
 
     public void testCreatePurchaseOrder() throws Exception {
-        Map <String, Object> ctx = new HashMap<String, Object>();
+        Map <String, Object> ctx = new HashMap<>();
         ctx.put("partyId", "Company");
         ctx.put("orderTypeId", "PURCHASE_ORDER");
         ctx.put("currencyUom", "USD");
@@ -60,30 +60,30 @@ public class PurchaseOrderTest extends O
         orderItem.set("unitListPrice", BigDecimal.ZERO);
         orderItem.set("isModifiedPrice", "N");
         orderItem.set("statusId", "ITEM_CREATED");
-        List <GenericValue> orderItems = new LinkedList<GenericValue>();
+        List <GenericValue> orderItems = new LinkedList<>();
         orderItems.add(orderItem);
         ctx.put("orderItems", orderItems);
 
         GenericValue orderContactMech = delegator.makeValue("OrderContactMech", UtilMisc.toMap("contactMechPurposeTypeId", "SHIPPING_LOCATION", "contactMechId", "9000"));
-        List <GenericValue> orderContactMechs = new LinkedList<GenericValue>();
+        List <GenericValue> orderContactMechs = new LinkedList<>();
         orderContactMechs.add(orderContactMech);
         ctx.put("orderContactMechs", orderContactMechs);
 
         GenericValue orderItemContactMech = delegator.makeValue("OrderItemContactMech", UtilMisc.toMap("contactMechPurposeTypeId", "SHIPPING_LOCATION", "contactMechId", "9000", "orderItemSeqId", "00001"));
-        List <GenericValue> orderItemContactMechs = new LinkedList<GenericValue>();
+        List <GenericValue> orderItemContactMechs = new LinkedList<>();
         orderItemContactMechs.add(orderItemContactMech);
         ctx.put("orderItemContactMechs", orderItemContactMechs);
 
         GenericValue orderItemShipGroup = delegator.makeValue("OrderItemShipGroup", UtilMisc.toMap("carrierPartyId", "UPS", "contactMechId", "9000", "isGift", "N", "maySplit", "N", "shipGroupSeqId", "00001", "shipmentMethodTypeId", "NEXT_DAY"));
         orderItemShipGroup.set("carrierRoleTypeId","CARRIER");
-        List <GenericValue> orderItemShipGroupInfo = new LinkedList<GenericValue>();
+        List <GenericValue> orderItemShipGroupInfo = new LinkedList<>();
         orderItemShipGroupInfo.add(orderItemShipGroup);
         ctx.put("orderItemShipGroupInfo", orderItemShipGroupInfo);
 
-        List <GenericValue> orderTerms = new LinkedList<GenericValue>();
+        List <GenericValue> orderTerms = new LinkedList<>();
         ctx.put("orderTerms", orderTerms);
 
-        List <GenericValue> orderAdjustments = new LinkedList<GenericValue>();
+        List <GenericValue> orderAdjustments = new LinkedList<>();
         ctx.put("orderAdjustments", orderAdjustments);
 
         ctx.put("billToCustomerPartyId", "Company");

Modified: ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/test/SalesOrderTest.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/test/SalesOrderTest.java?rev=1818431&r1=1818430&r2=1818431&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/test/SalesOrderTest.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/test/SalesOrderTest.java Sat Dec 16 16:03:08 2017
@@ -48,7 +48,7 @@ public class SalesOrderTest extends OFBi
     public void testCreateSalesOrder() throws Exception {
         Map<String, Object> ctx = UtilMisc.<String, Object>toMap("partyId", "DemoCustomer", "orderTypeId", "SALES_ORDER", "currencyUom", "USD", "productStoreId", "9000");
 
-        List<GenericValue> orderPaymentInfo = new LinkedList<GenericValue>();
+        List<GenericValue> orderPaymentInfo = new LinkedList<>();
         GenericValue orderContactMech = delegator.makeValue("OrderContactMech", UtilMisc.toMap("contactMechId", "9015", "contactMechPurposeTypeId", "BILLING_LOCATION"));
         orderPaymentInfo.add(orderContactMech);
 
@@ -57,7 +57,7 @@ public class SalesOrderTest extends OFBi
         orderPaymentInfo.add(orderPaymentPreference);
         ctx.put("orderPaymentInfo", orderPaymentInfo);
 
-        List<GenericValue> orderItemShipGroupInfo = new LinkedList<GenericValue>();
+        List<GenericValue> orderItemShipGroupInfo = new LinkedList<>();
         orderContactMech.set("contactMechPurposeTypeId", "SHIPPING_LOCATION");
         orderItemShipGroupInfo.add(orderContactMech);
 
@@ -101,12 +101,12 @@ public class SalesOrderTest extends OFBi
 
         ctx.put("orderItemShipGroupInfo", orderItemShipGroupInfo);
 
-        List<GenericValue> orderAdjustments = new LinkedList<GenericValue>();
+        List<GenericValue> orderAdjustments = new LinkedList<>();
         orderAdjustment = delegator.makeValue("OrderAdjustment", UtilMisc.toMap("orderAdjustmentTypeId", "PROMOTION_ADJUSTMENT", "productPromoActionSeqId", "01", "productPromoId", "9011", "productPromoRuleId", "01", "amount", BigDecimal.valueOf(-3.84)));
         orderAdjustments.add(orderAdjustment);
         ctx.put("orderAdjustments", orderAdjustments);
 
-        List<GenericValue> orderItems = new LinkedList<GenericValue>();
+        List<GenericValue> orderItems = new LinkedList<>();
         GenericValue orderItem = delegator.makeValue("OrderItem", UtilMisc.toMap("orderItemSeqId", "00001", "orderItemTypeId", "PRODUCT_ORDER_ITEM", "prodCatalogId", "DemoCatalog", "productId", "GZ-2644", "quantity", BigDecimal.ONE, "selectedAmount", BigDecimal.ZERO));
         orderItem.set("isPromo", "N");
         orderItem.set("isModifiedPrice", "N");
@@ -114,7 +114,7 @@ public class SalesOrderTest extends OFBi
         orderItem.set("unitListPrice", new BigDecimal("48.0"));
         orderItem.set("statusId", "ITEM_CREATED");
         orderItems.add(orderItem);
-        
+
         orderItem = delegator.makeValue("OrderItem", UtilMisc.toMap("orderItemSeqId", "00002", "orderItemTypeId", "PRODUCT_ORDER_ITEM", "prodCatalogId", "DemoCatalog", "productId", "GZ-1006-1", "quantity", BigDecimal.ONE, "selectedAmount", BigDecimal.ZERO));
         orderItem.set("isPromo", "N");
         orderItem.set("isModifiedPrice", "N");
@@ -122,10 +122,10 @@ public class SalesOrderTest extends OFBi
         orderItem.set("unitListPrice", new BigDecimal("5.99"));
         orderItem.set("statusId", "ITEM_CREATED");
         orderItems.add(orderItem);
-        
+
         ctx.put("orderItems", orderItems);
 
-        List<GenericValue> orderTerms = new LinkedList<GenericValue>();
+        List<GenericValue> orderTerms = new LinkedList<>();
         ctx.put("orderTerms", orderTerms);
 
         GenericValue OrderContactMech = delegator.makeValue("OrderContactMech");