Package de.hybris.platform.order
Class ZoneDeliveryModeServiceTest
- java.lang.Object
-
- de.hybris.platform.testframework.HybrisJUnit4Test
-
- de.hybris.platform.servicelayer.ServicelayerBaseTest
-
- de.hybris.platform.servicelayer.ServicelayerTest
-
- de.hybris.platform.servicelayer.ServicelayerTransactionalTest
-
- de.hybris.platform.order.ZoneDeliveryModeServiceTest
-
- All Implemented Interfaces:
JaloSessionHolder
@DemoTest public class ZoneDeliveryModeServiceTest extends ServicelayerTransactionalTest
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.servicelayer.ServicelayerTest
importService
-
Fields inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
jaloSession
-
-
Constructor Summary
Constructors Constructor Description ZoneDeliveryModeServiceTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setUp()
Creates the core data, and necessary data for delivery modes.void
testGetCurrencies()
Tries to search for the supported currencies in theZoneModel
and with theZoneDeliveryModeModel
: retrievesZoneDeliveryModeModel
with code "dhl", retrievesZoneModel
with code "de", tests there is one supported currency for the foundZoneModel
andZoneDeliveryModeModel
retrievesZoneDeliveryModeModel
with code "ups", retrievesZoneModel
with code "world", tests there are 2 supported currencies for the foundZoneModel
andZoneDeliveryModeModel
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.void
testGetDeliveryValue()
Tries to search for the delivery value with the currency in the zone and with the specific delivery mode.void
testGetDeliveryValues()
Tries to search for the delivery values with the currency in the zone and with the specific delivery mode.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 5void
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.void
testGetZonesForDeliveryMode()
Tries to search for the zones with the specificZoneDeliveryModeModel
: found 3 zones for "dhl". found 2 zones for "fedex". found 3 zones for "ups".void
testIsZoneAllowed()
Tests whether the specific zone is allowed for the delivery mode.void
testSetDeliveryCost()
Tries to set the delivery value with the currency and minimum value in the zone and with the specific delivery mode.-
Methods inherited from class de.hybris.platform.servicelayer.ServicelayerTest
createCoreData, createDefaultCatalog, createDefaultUsers, createHardwareCatalog, getApplicationContext, importCsv, importData, importData, importData, importStream, importStream, isPrefetchModeNone
-
Methods inherited from class de.hybris.platform.servicelayer.ServicelayerBaseTest
autowireProperties, getBeanName, prepareApplicationContextAndSession
-
Methods inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
establishJaloSession, finish, getOrCreateCurrency, getOrCreateLanguage, init, intenseChecksActivated, takeJaloSession
-
-
-
-
Method Detail
-
setUp
public void setUp() throws java.lang.Exception
Creates the core data, and necessary data for delivery modes.- Throws:
java.lang.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 specificZoneDeliveryModeModel
:- 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 theZoneModel
and with theZoneDeliveryModeModel
:- retrieves
ZoneDeliveryModeModel
with code "dhl", - retrieves
ZoneModel
with code "de", - tests there is one supported currency for the found
ZoneModel
andZoneDeliveryModeModel
- retrieves
ZoneDeliveryModeModel
with code "ups", - retrieves
ZoneModel
with code "world", - tests there are 2 supported currencies for the found
ZoneModel
andZoneDeliveryModeModel
- retrieves
-
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
-
-