public final class RemovePrice extends UpdateActionImpl<T>
See also ProductUpdateCommand.
withUpdateablePricedProduct(client(), product -> { final Price oldPrice = getFirstPrice(product); final Product updatedProduct = client() .executeBlocking(ProductUpdateCommand.of(product, RemovePrice.of(oldPrice))); assertThat(updatedProduct.getMasterData().getStaged().getMasterVariant() .getPrices().stream().anyMatch(p -> p.equals(oldPrice))).isFalse(); return updatedProduct; });
See the test code.
Modifier and Type | Method and Description |
---|---|
String |
getPriceId() |
Boolean |
isStaged() |
static RemovePrice |
of(Price price)
Action to remove a price
|
static RemovePrice |
of(Price price,
Boolean staged) |
static RemovePrice |
of(String priceId) |
static RemovePrice |
of(String priceId,
Boolean staged) |
getAction
public String getPriceId()
public static RemovePrice of(Price price)
price
- the price to remove including an IDpublic static RemovePrice of(Price price, @Nullable Boolean staged)
public static RemovePrice of(String priceId)
public static RemovePrice of(String priceId, @Nullable Boolean staged)