use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow in project kie-wb-common by kiegroup.
the class NotificationValueValidatorTest method test3DigExpiresAtNotificationRow.
@Test
public void test3DigExpiresAtNotificationRow() {
NotificationRow value = new NotificationRow();
value.setExpiresAt("111d");
boolean result = validator.isValid(value, context);
assertTrue(result);
assertTrue(errorMessages.isEmpty());
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow in project kie-wb-common by kiegroup.
the class NotificationValueValidatorTest method testR2PT4H20190527T133300Z.
@Test
public void testR2PT4H20190527T133300Z() {
NotificationRow notification = new NotificationRow();
notification.setExpiresAt("R2/PT4H/2019-05-27T13:33:00Z");
boolean result = validator.isValid(notification, context);
assertTrue(result);
assertTrue(errorMessages.isEmpty());
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow in project kie-wb-common by kiegroup.
the class NotificationValueValidatorTest method testDurationsW.
@Test
public void testDurationsW() {
NotificationRow value = new NotificationRow();
value.setExpiresAt("P1WT20H13M");
boolean result = validator.isValid(value, context);
assertTrue(result);
assertTrue(errorMessages.isEmpty());
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow in project kie-wb-common by kiegroup.
the class NotificationValueValidatorTest method testR0120011201T133402P1M1D.
@Test
public void testR0120011201T133402P1M1D() {
NotificationRow value = new NotificationRow();
value.setExpiresAt("R0/2001-12-01T13:34+02/P1M1D");
boolean result = validator.isValid(value, context);
assertFalse(result);
assertEquals(NotificationValueValidator.WRONG_EXPIRES_AT_EXPRESSION, errorMessages.get(0));
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow in project kie-wb-common by kiegroup.
the class NotificationWidgetViewImplTest method testOnAddNewValueAndClose.
@Test
public void testOnAddNewValueAndClose() {
dataProvider.setList(new ArrayList<>());
final NotificationTypeListValue[] value = new NotificationTypeListValue[1];
NotificationsEditorWidget.GetNotificationsCallback callback = v -> value[0] = v;
setFieldValue(presenter, "view", view);
notificationWidgetViewImpl.init(presenter, generateRows());
presenter.setCallback(callback);
setFieldValue(notificationWidgetViewImpl, "editor", notificationEditorWidget);
setFieldValue(notificationEditorWidget, "view", notificationEditorWidgetImpl);
NotificationRow newRow = new NotificationRow();
newRow.setId(111);
notificationWidgetViewImpl.addOrEdit(newRow);
notificationWidgetViewImpl.onSubscription(new NotificationEvent(null));
notificationWidgetViewImpl.ok();
notificationWidgetViewImpl.hide();
Assert.assertEquals(0, presenter.getValue().size());
Assert.assertEquals(4, value[0].getValues().size());
}
Aggregations