Class ZoneDeliveryModeServiceTest

All Implemented Interfaces:
JaloSessionHolder

@DemoTest public class ZoneDeliveryModeServiceTest extends ServicelayerTransactionalTest
  • Constructor Details

    • ZoneDeliveryModeServiceTest

      public ZoneDeliveryModeServiceTest()
  • Method Details

    • setUp

      public void setUp() throws Exception
      Creates the core data, and necessary data for delivery modes.
      Throws:
      Exception
    • testGetDeliveryMode

      public void testGetDeliveryMode()
      Tries to search for the delivery mode with code:
      • successful with "courier",
      • caught UnknownIdentifierException with "No_Such_DeliveryMode",
      • found all delivery modes, whose size is 3.
    • testGetSupportedDeliveryModes

      public void testGetSupportedDeliveryModes()
      Tries to search for the supported delivery modes with the payment mode:
      • found payment mode with "creditcard",
      • found all supported delivery modes for this payment mode, which is 5
    • testGetZone

      public void testGetZone()
      Tries to search for the zone with code:
      • successful with "europe",
      • caught UnknownIdentifierException with "No_Such_Zone",
      • found all zones, whose size is 3.
    • testGetZonesForDeliveryMode

      public void testGetZonesForDeliveryMode()
      Tries to search for the zones with the specific ZoneDeliveryModeModel:
      • found 3 zones for "dhl".
      • found 2 zones for "fedex".
      • found 3 zones for "ups".
    • testGetCurrencies

      public void testGetCurrencies()
      Tries to search for the supported currencies in the ZoneModel and with the ZoneDeliveryModeModel:
    • testSetDeliveryCost

      public void testSetDeliveryCost()
      Tries to set the delivery value with the currency and minimum value in the zone and with the specific delivery mode.
      • tests that it costs 10 Euro in Germany, with dhl and with minimum value 0 Euro,
      • tests that there are 3(unchanged) delivery values after the setter.
      • tests that it costs 5 Euro in Germany, with dhl and with minimum value 10 Euro,
      • tests that there are 4(one more) delivery values after the setter.
      • tests that another zone delivery mode value with the same minimum value cannot be created.
    • testGetDeliveryValue

      public void testGetDeliveryValue()
      Tries to search for the delivery value with the currency in the zone and with the specific delivery mode.
      • tests that it costs 6 Euro in Germany, with dhl and with minimum value 0 Euro,
      • tests that it costs 4 Euro in Germany, with dhl and with minimum value 20 Euro,
      • tests that an UnknownIdentifierException is thrown in Germany, with dhl and with minimum value 10 Euro,
      • tests that it is free shipping in Germany, with dhl and with minimum value 50 Euro.
      • tests that it costs 15 USD in Europe, with dhl and with minimum value 0 USD.
    • testGetDeliveryValues

      public void testGetDeliveryValues()
      Tries to search for the delivery values with the currency in the zone and with the specific delivery mode.
      • tests there are 3 delivery cost values for EURO in Germany and with dhl,
      • tests there are 2 delivery cost values for EURO in Europe and with dhl,
      • tests there are 2 delivery cost values for EURO worldwide and with dhl.
      • tests there is no delivery cost values for USD in Germany and with dhl,
      • tests there is exactly one delivery cost value for USD worldwide and with dhl.
    • testIsZoneAllowed

      public void testIsZoneAllowed()
      Tests whether the specific zone is allowed for the delivery mode.
      • retrieves two delivery modes, "dhl" and "fedex"
      • retrieves three zones, de, europe and world
      • creates a new zone "mid_europe" including Germany and Austria
      • tests the three old zones are allowed for both delivery modes
      • tests the new zone is not allowed for the either of the delivery modes