public interface ShippingMethodsByOrderEditGet extends MetaModelGetDsl<List<ShippingMethod>,ShippingMethod,ShippingMethodsByCartGet,ShippingMethodExpansionModel<ShippingMethod>>
withShippingMethodForGermany(client(), shippingMethod -> { OrderFixtures.withOrder(client(), order -> { OrderEditFixtures.withOrderEdit(client(), order.toReference(), orderEdit -> { final SphereRequest<List<ShippingMethod>> sphereRequest = new VrapRequestDecorator<>(ShippingMethodsByOrderEditGet.of(orderEdit, CountryCode.DE), "response"); final List<ShippingMethod> shippingMethodsByOrderEdit = client().executeBlocking(sphereRequest); assertThat(shippingMethodsByOrderEdit).isNotEmpty(); for (final ShippingMethod shippingMethodByOrderEdit : shippingMethodsByOrderEdit) { final List<ShippingRate> shippingRates = shippingMethodByOrderEdit.getZoneRates().stream() .flatMap(zoneRate -> zoneRate.getShippingRates().stream()) .collect(Collectors.toList()); assertThat(shippingRates).areAtLeastOne(new Condition<>(ShippingRate::isMatching, "Shipping rate is matching")); assertThat(shippingMethodByOrderEdit.getZones()).isNotEmpty(); } }); }); });
See the test code.
Modifier and Type | Method and Description |
---|---|
static ShippingMethodsByOrderEditGet |
of(Identifiable<OrderEdit> orderEdit,
com.neovisionaries.i18n.CountryCode countryCode) |
static ShippingMethodsByOrderEditGet |
of(Identifiable<OrderEdit> orderEdit,
com.neovisionaries.i18n.CountryCode countryCode,
String state) |
deserialize
canDeserialize, httpRequestIntent
plusExpansionPaths, withExpansionPaths
plusExpansionPaths, plusExpansionPaths, plusExpansionPaths, plusExpansionPaths, withExpansionPaths, withExpansionPaths, withExpansionPaths, withExpansionPaths
expansionPaths
static ShippingMethodsByOrderEditGet of(Identifiable<OrderEdit> orderEdit, com.neovisionaries.i18n.CountryCode countryCode)
static ShippingMethodsByOrderEditGet of(Identifiable<OrderEdit> orderEdit, com.neovisionaries.i18n.CountryCode countryCode, String state)