public interface ShippingMethodsByLocationGet extends MetaModelGetDsl<List<ShippingMethod>,ShippingMethod,ShippingMethodsByCartGet,ShippingMethodExpansionModel<ShippingMethod>>
withShippingMethodForGermany(client(), shippingMethod -> { final SphereRequest<List<ShippingMethod>> sphereRequest = new VrapRequestDecorator<>(ShippingMethodsByLocationGet.of(CountryCode.DE).withExpansionPaths(m -> m.zones()), "response"); final List<ShippingMethod> shippingMethodsByLocation = client().executeBlocking(sphereRequest); assertThat(shippingMethodsByLocation).isNotEmpty(); for (final ShippingMethod shippingMethodByLocation : shippingMethodsByLocation) { final List<ShippingRate> shippingRates = shippingMethodByLocation.getZoneRates().stream() .flatMap(zoneRate -> zoneRate.getShippingRates().stream()) .collect(Collectors.toList()); assertThat(shippingRates).areAtLeastOne(new Condition<>(ShippingRate::isMatching, "Shipping rate is matching")); assertThat(shippingMethodByLocation.getZones()).isNotEmpty(); assertThat(shippingMethodByLocation.getZones().get(0).getObj()).isNotNull(); } });
See the test code.
Modifier and Type | Method and Description |
---|---|
static ShippingMethodsByLocationGet |
of(com.neovisionaries.i18n.CountryCode countryCode) |
static ShippingMethodsByLocationGet |
of(com.neovisionaries.i18n.CountryCode countryCode,
javax.money.CurrencyUnit currencyUnit) |
static ShippingMethodsByLocationGet |
of(com.neovisionaries.i18n.CountryCode countryCode,
String state) |
static ShippingMethodsByLocationGet |
of(com.neovisionaries.i18n.CountryCode countryCode,
String state,
javax.money.CurrencyUnit currencyUnit) |
deserialize
canDeserialize, httpRequestIntent
plusExpansionPaths, withExpansionPaths
plusExpansionPaths, plusExpansionPaths, plusExpansionPaths, plusExpansionPaths, withExpansionPaths, withExpansionPaths, withExpansionPaths, withExpansionPaths
expansionPaths
static ShippingMethodsByLocationGet of(com.neovisionaries.i18n.CountryCode countryCode)
static ShippingMethodsByLocationGet of(com.neovisionaries.i18n.CountryCode countryCode, String state)
static ShippingMethodsByLocationGet of(com.neovisionaries.i18n.CountryCode countryCode, javax.money.CurrencyUnit currencyUnit)
static ShippingMethodsByLocationGet of(com.neovisionaries.i18n.CountryCode countryCode, String state, javax.money.CurrencyUnit currencyUnit)