use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.
the class ReasonBuffer2_Test method with_no_prefix.
@Test
public void with_no_prefix() throws Exception {
final ReasonBuffer2 buf = ReasonBuffer2.forAll();
buf.append(true, "reason #1");
buf.append(false, "reason #2");
buf.append(true, "reason #3");
Assertions.assertThat(buf.getReason()).isEqualTo("reason #1; reason #3");
}
use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.
the class ReasonBuffer2_Test method with_null_reasons.
@Test
public void with_null_reasons() throws Exception {
final ReasonBuffer2 buf = ReasonBuffer2.forAll();
buf.append(true, null);
Assertions.assertThat(buf.getReason()).isNull();
}
use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.
the class ReasonBuffer2_Test method using_lazy_reasons.
@Test
public void using_lazy_reasons() throws Exception {
final ReasonBuffer2 buf = ReasonBuffer2.forAll("Cannot change");
buf.append(() -> "reason #1");
buf.append(() -> null);
buf.append((ReasonBuffer2.LazyReason) null);
buf.append(() -> "reason #3");
Assertions.assertThat(buf.getReason()).isEqualTo("Cannot change: reason #1; reason #3");
}
use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.
the class IncomingInvoiceDownloadManager method disableReport.
public String disableReport() {
ReasonBuffer2 buf = ReasonBuffer2.forSingle();
buf.append(getReportedDate() != null, "Clear 'report date' in order to report on all items currently unreported.");
buf.append(getInvoices().isEmpty(), "No invoices");
return buf.getReason();
}
use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.
the class OrderItem method disableUpdateAmounts.
public String disableUpdateAmounts() {
ReasonBuffer2 buf = ReasonBuffer2.forSingle();
itemImmutableIfOrderImmutable(buf);
return buf.getReason();
}
Aggregations