Program: 130831
Project: 130831
Buggy source:
@Test public void execution() throws Exception {
  withPersistentCartDiscount(client(),cartDiscount -> {
    final String code=randomKey();
    final DiscountCodeDraft draft=DiscountCodeDraft.of(code,cartDiscount).withName(en(DiscountCodeCreateCommandIntegrationTest.class.getName())).withDescription(en("String_Node_Str")).withCartPredicate(CartPredicate.of("String_Node_Str")).withIsActive(false).withMaxApplications(5L).withMaxApplicationsPerCustomer(1L);
    final DiscountCodeCreateCommand createCommand=DiscountCodeCreateCommand.of(draft).plusExpansionPaths(m -> m.cartDiscounts());
    final DiscountCode discountCode=client().executeBlocking(createCommand);
    assertThat(discountCode.getCode()).isEqualTo(code);
    assertThat(discountCode.getName()).isEqualTo(en(DiscountCodeCreateCommandIntegrationTest.class.getName()));
    assertThat(discountCode.getDescription()).isEqualTo(en("String_Node_Str"));
    final Reference<CartDiscount> cartDiscountReference=discountCode.getCartDiscounts().get(0);
    assertThat(cartDiscountReference).isEqualTo(cartDiscount.toReference()).is(expanded());
    assertThat(discountCode.getCartPredicate()).contains("String_Node_Str");
    assertThat(discountCode.isActive()).isEqualTo(false);
    assertThat(discountCode.getMaxApplications()).isEqualTo(5L);
    assertThat(discountCode.getMaxApplicationsPerCustomer()).isEqualTo(1L);
    client().executeBlocking(DiscountCodeDeleteCommand.of(discountCode));
  }
);
}

Fixed version (ground truth):
@Test public void execution() throws Exception {
  withPersistentCartDiscount(client(),cartDiscount -> {
    final ZonedDateTime start=ZonedDateTime.parse("String_Node_Str");
    final ZonedDateTime end=start.plusMonths(3);
    final String code=randomKey();
    final DiscountCodeDraft draft=DiscountCodeDraft.of(code,cartDiscount).withName(en(DiscountCodeCreateCommandIntegrationTest.class.getName())).withDescription(en("String_Node_Str")).withCartPredicate(CartPredicate.of("String_Node_Str")).withIsActive(false).withMaxApplications(5L).withValidFrom(start).withValidUntil(end).withMaxApplicationsPerCustomer(1L);
    final DiscountCodeCreateCommand createCommand=DiscountCodeCreateCommand.of(draft).plusExpansionPaths(m -> m.cartDiscounts());
    final DiscountCode discountCode=client().executeBlocking(createCommand);
    assertThat(discountCode.getCode()).isEqualTo(code);
    assertThat(discountCode.getName()).isEqualTo(en(DiscountCodeCreateCommandIntegrationTest.class.getName()));
    assertThat(discountCode.getDescription()).isEqualTo(en("String_Node_Str"));
    assertThat(discountCode.getValidFrom()).isEqualTo(start);
    assertThat(discountCode.getValidUntil()).isEqualTo(end);
    final Reference<CartDiscount> cartDiscountReference=discountCode.getCartDiscounts().get(0);
    assertThat(cartDiscountReference).isEqualTo(cartDiscount.toReference()).is(expanded());
    assertThat(discountCode.getCartPredicate()).contains("String_Node_Str");
    assertThat(discountCode.isActive()).isEqualTo(false);
    assertThat(discountCode.getMaxApplications()).isEqualTo(5L);
    assertThat(discountCode.getMaxApplicationsPerCustomer()).isEqualTo(1L);
    client().executeBlocking(DiscountCodeDeleteCommand.of(discountCode));
  }
);
}