public final class SetMaxApplicationsPerCustomer extends UpdateActionImpl<DiscountCode>
See also DiscountCodeUpdateCommand.
withPersistentDiscountCode(client(), discountCode -> {
final long maxApplications = randomLong();
final DiscountCode updatedDiscountCode =
client().executeBlocking(DiscountCodeUpdateCommand.of(discountCode, SetMaxApplicationsPerCustomer.of(maxApplications)));
assertThat(updatedDiscountCode.getMaxApplicationsPerCustomer()).isEqualTo(maxApplications);
});
See the test code.
Modifier and Type | Method and Description |
---|---|
Long |
getMaxApplicationsPerCustomer() |
static SetMaxApplicationsPerCustomer |
of(Long maxApplications) |
getAction
public static SetMaxApplicationsPerCustomer of(@Nullable Long maxApplications)