public static ChangeIsDefault of(final boolean isDefault) { return new ChangeIsDefault(isDefault); }
public static ChangeIsDefault toFalse() { return of(false); } }
@Test public void changeIsDefault() throws Exception { //only one can be default one, so clean up if there is any final Query<ShippingMethod> query = ShippingMethodQuery.of().withPredicates(QueryPredicate.of("isDefault = true")); final Optional<ShippingMethod> defaultShippingMethodOption = client().executeBlocking(query).head(); defaultShippingMethodOption.ifPresent(sm -> client().executeBlocking(ShippingMethodUpdateCommand.of(sm, ChangeIsDefault.toFalse()))); withUpdateableShippingMethod(client(), shippingMethod -> { assertThat(shippingMethod.isDefault()).isFalse(); final ShippingMethodUpdateCommand cmd = ShippingMethodUpdateCommand.of(shippingMethod, ChangeIsDefault.toTrue()); final ShippingMethod updatedShippingMethod = client().executeBlocking(cmd); assertThat(updatedShippingMethod.isDefault()).isTrue(); final Long defaultShippingMethods = client().executeBlocking(ShippingMethodQuery.of().byIsDefault()).getCount(); assertThat(defaultShippingMethods).isEqualTo(1); return client().executeBlocking(ShippingMethodUpdateCommand.of(updatedShippingMethod, ChangeIsDefault.toFalse())); }); }
public static ChangeIsDefault toFalse() { return of(false); } }
public static ChangeIsDefault of(final boolean isDefault) { return new ChangeIsDefault(isDefault); }
public static ChangeIsDefault toFalse() { return of(false); } }
public static ChangeIsDefault of(final boolean isDefault) { return new ChangeIsDefault(isDefault); }
public static ChangeIsDefault toFalse() { return of(false); } }
public static ChangeIsDefault of(final boolean isDefault) { return new ChangeIsDefault(isDefault); }
public static ChangeIsDefault toTrue() { return of(true); }
public static ChangeIsDefault toTrue() { return of(true); }
public static ChangeIsDefault toTrue() { return of(true); }
public static ChangeIsDefault toTrue() { return of(true); }