Class BasecommerceTest

All Implemented Interfaces:
JaloSessionHolder

public class BasecommerceTest extends ServicelayerTest
JUnit Tests for the Basecommerce extension
  • Constructor Details

    • BasecommerceTest

      public BasecommerceTest()
  • Method Details

    • setUp

      public void setUp() throws Exception
      Throws:
      Exception
    • testMultiAddressCalculation

      public void testMultiAddressCalculation() throws JaloDeliveryModeException, JaloPriceFactoryException
      Scenario: 1
      testProduct0 -> deliveryModeCode1( delivery cost:= 4.2 )
      testProduct1 -> deliveryModeCode1( delivery cost:= 4.2 )
      ==> package no.1 ( delivery cost:= 4.2 )
      testProduct2 -> deliveryModeCode3( delivery cost:= 3.8 )
      ==> package no.2 ( delivery cost:= 3.8 )
      usage of DefaultMultiAddressDeliveryCostsStrategy -> total sum of delivery costs: 8.0

      Scenario: 2
      usage of DefaultDeliveryCostsStrategy -> total sum of delivery costs: 0.0

      Scenario: 3
      testProduct0 -> deliveryModeCode1( delivery cost:= 4.2 )
      testProduct1 -> deliveryModeCode1( delivery cost:= 4.2 )
      ==> package no.1 ( delivery cost:= 4.2 )
      testProduct2 -> deliveryMode is null -> fallback to delivery mode of order( delivery cost:= 0.0 )
      ==> package no.2 ( delivery cost:= 0.0 )
      usage of DefaultMultiAddressDeliveryCostsStrategy -> total sum of delivery costs: 4.2

      Scenario: 4
      testProduct0 -> deliveryAddress is null -> fallback to delivery address of order -> additional package
      ==> package no.1 ( delivery cost:= 4.2 )
      ==> package no.2 ( delivery cost:= 4.2 )
      ==> package no.3 ( delivery cost:= 0.0 )
      usage of DefaultMultiAddressDeliveryCostsStrategy -> total sum of delivery costs: 8.4
      Throws:
      JaloPriceFactoryException
      JaloDeliveryModeException
    • createCoreData

      public static void createCoreData() throws Exception
      Throws:
      Exception
    • createDefaultCatalog

      public static void createDefaultCatalog() throws Exception
      Throws:
      Exception
    • createOrder

      public void createOrder() throws InvalidCartException, Exception
      Throws:
      InvalidCartException
      Exception