/** * Creates a new update action to unset the {@code description} property. * @return the {@code SetDescription} update action. */ public static SetDescription ofUnset() { return new SetDescription(null); } }
public static SetDescription of(final String description) { return of(Optional.of(description)); }
public static SetDescription of(final Optional<String> description) { return new SetDescription(description); }
@Test public void setDescription() throws Exception { withUpdateableShippingMethod(client(), shippingMethod -> { final String newDescription = randomString(); assertThat(shippingMethod.getDescription()).isNotEqualTo(newDescription); final ShippingMethodUpdateCommand cmd = ShippingMethodUpdateCommand.of(shippingMethod, SetDescription.of(newDescription)); final ShippingMethod updatedShippingMethod = client().executeBlocking(cmd); assertThat(updatedShippingMethod.getDescription()).isEqualTo(newDescription); return updatedShippingMethod; }); }
/** * Creates a new update action from the given parameters. * * @param description the {@code description} property {@link ShippingMethod#getDescription()}. * @return the {@code SetDescription} update action. */ public static SetDescription of(@Nullable final String description) { return new SetDescription(description); }
@Test public void updateByKey() throws Exception { final String key = randomKey(); withUpdateableShippingMethod(client(), builder -> builder.key(key), shippingMethod -> { final String newDescription = randomString(); assertThat(shippingMethod.getDescription()).isNotEqualTo(newDescription); final ShippingMethodUpdateCommand cmd = ShippingMethodUpdateCommand.ofKey(key, shippingMethod.getVersion(), SetDescription.of(newDescription)); final ShippingMethod updatedShippingMethod = client().executeBlocking(cmd); assertThat(updatedShippingMethod.getDescription()).isEqualTo(newDescription); return updatedShippingMethod; }); }
public static SetDescription of(@Nullable final String description) { return new SetDescription(description); }