use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow in project kie-wb-common by kiegroup.
the class NotificationValueValidatorTest method test1DigExpiresAtNotificationRow.
@Test
public void test1DigExpiresAtNotificationRow() {
NotificationRow value = new NotificationRow();
value.setExpiresAt("1d");
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 testR4T4HR4T6H.
@Test
public void testR4T4HR4T6H() {
NotificationRow value = new NotificationRow();
value.setExpiresAt("R4/PT4H,R4/PT6H");
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 NotificationWidgetViewImplTest method generateRows.
private List<NotificationRow> generateRows() {
List<NotificationRow> rows = new ArrayList<>();
NotificationRow row1 = new NotificationRow();
row1.setId(1);
NotificationRow row2 = new NotificationRow();
row2.setId(2);
NotificationRow row3 = new NotificationRow();
row3.setId(3);
NotificationRow row4 = new NotificationRow();
row4.setId(4);
rows.add(row1);
rows.add(row2);
rows.add(row3);
rows.add(row4);
return rows;
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow in project kie-wb-common by kiegroup.
the class NotificationWidgetViewImplTest method testOnAddNewValueAndSave.
@Test
public void testOnAddNewValueAndSave() {
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(newRow));
notificationWidgetViewImpl.ok();
notificationWidgetViewImpl.hide();
Assert.assertEquals(0, presenter.getValue().size());
Assert.assertEquals(5, value[0].getValues().size());
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.NotificationRow in project kie-wb-common by kiegroup.
the class NotificationEditorWidgetTest method testCreateAndClose.
@Test
public void testCreateAndClose() {
List<String> groups = Arrays.asList("AAA", "BBB", "CCC", "DDD");
List<String> users = Arrays.asList("aaa", "bbb", "ccc");
doNothing().when(view).hide();
when(subject.getValue()).thenReturn("QWERTY!");
when(body.getValue()).thenReturn("QWERTY!");
NotificationRow test = new NotificationRow();
doNothing().when(view).hide();
when(customerBinder.getModel()).thenReturn(test);
when(notCompleted.getValue()).thenReturn(NOT_STARTED_NOTIFY.getAlias());
when(typeSelect.getSelectedItem()).thenReturn(notCompleted);
when(searchSelectionReplyToHandler.getSelectedValue()).thenReturn("admin");
when(searchSelectionFromHandler.getSelectedValue()).thenReturn("admin");
when(multipleLiveSearchSelectionHandlerGroups.getSelectedValues()).thenReturn(groups);
when(multipleLiveSearchSelectionHandlerUsers.getSelectedValues()).thenReturn(users);
view.createOrEdit(notificationWidgetViewImpl, test);
view.close();
Assert.assertNotEquals("QWERTY!", test.getSubject());
Assert.assertNotEquals("QWERTY!", test.getBody());
Assert.assertNotEquals("admin", test.getReplyTo());
Assert.assertNotEquals("admin", test.getFrom());
Assert.assertNotEquals(NOT_STARTED_NOTIFY, test.getType());
Assert.assertNotEquals(groups, test.getGroups());
Assert.assertNotEquals(users, test.getUsers());
}
Aggregations