Search in sources :

Example 6 with NotificationValue

use of org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue in project kie-wb-common by kiegroup.

the class ParsedNotificationsInfosTest method testNotificationPartialVerticalBar.

@Test
public void testNotificationPartialVerticalBar() {
    String body = "[from:|tousers:|togroups:|replyTo:|subject:ZZZ|ZZZ|ZZZ||body:asd|||asd]@[0h]";
    NotificationValue actual = ParsedNotificationsInfos.of(AssociationType.NOT_COMPLETED_NOTIFY.getName(), body);
    NotificationValue expected = new NotificationValue();
    expected.setType(AssociationType.NOT_COMPLETED_NOTIFY.getName());
    expected.setExpiresAt("0h");
    expected.setBody("asd|||asd");
    expected.setSubject("ZZZ|ZZZ|ZZZ|");
    assertEquals(expected.toString(), actual.toString());
    assertEquals(expected.toCDATAFormat(), actual.toCDATAFormat());
    assertEquals(expected, actual);
}
Also used : NotificationValue(org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue) Test(org.junit.Test)

Example 7 with NotificationValue

use of org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue in project kie-wb-common by kiegroup.

the class NotificationRowTest method testToNotificationValue.

@Test
public void testToNotificationValue() {
    // Setup
    final NotificationValue expectedResult = new NotificationValue();
    expectedResult.setExpiresAt("");
    expectedResult.setFrom("");
    expectedResult.setBody("");
    expectedResult.setSubject("");
    expectedResult.setReplyTo("");
    expectedResult.setType("NotCompletedNotify");
    // Run the test
    final NotificationValue result = new NotificationRow().toNotificationValue();
    // Verify the results
    assertEquals(expectedResult, result);
}
Also used : NotificationValue(org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue) Test(org.junit.Test)

Example 8 with NotificationValue

use of org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue in project kie-wb-common by kiegroup.

the class NotificationPropertyWriterTest method getNotificationValue.

private NotificationValue getNotificationValue(String type) {
    List<String> users = new ArrayList<>();
    users.add("AAA");
    users.add("BBB");
    List<String> groups = new ArrayList<>();
    users.add("G1");
    users.add("G2");
    NotificationValue value = new NotificationValue();
    value.setType(type);
    value.setUsers(users);
    value.setGroups(groups);
    value.setFrom("User");
    value.setReplyTo("Admin");
    value.setSubject("Subj");
    value.setBody("Body");
    return value;
}
Also used : ArrayList(java.util.ArrayList) NotificationValue(org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue)

Example 9 with NotificationValue

use of org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue in project kie-wb-common by kiegroup.

the class NotificationTypeListValueTest method getNotificationValues.

private List<NotificationValue> getNotificationValues() {
    List<NotificationValue> result = new ArrayList<>();
    result.add(new NotificationValue("AAA", "1h", "Subj", "me", "NotStartedNotify", "me", Arrays.asList("foo", "bar", "baz"), Arrays.asList("foo", "bar", "baz"), ""));
    return result;
}
Also used : ArrayList(java.util.ArrayList) NotificationValue(org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue)

Example 10 with NotificationValue

use of org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue in project kie-wb-common by kiegroup.

the class NotificationsInfoTest method getNotificationValues.

private List<NotificationValue> getNotificationValues() {
    List<NotificationValue> result = new ArrayList<>();
    result.add(new NotificationValue("AAA", "1h", "Subj", "me", "NotStartedNotify", "me", Arrays.asList("foo", "bar", "baz"), Arrays.asList("foo", "bar", "baz"), ""));
    return result;
}
Also used : ArrayList(java.util.ArrayList) NotificationValue(org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue)

Aggregations

NotificationValue (org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationValue)16 Test (org.junit.Test)10 ArrayList (java.util.ArrayList)3 HTMLInputElement (elemental2.dom.HTMLInputElement)1 ValidNotificationValue (org.kie.workbench.common.stunner.bpmn.client.forms.fields.notificationsEditor.validation.ValidNotificationValue)1 ReflectionUtilsTest (org.kie.workbench.common.stunner.bpmn.client.forms.util.ReflectionUtilsTest)1 UserTask (org.kie.workbench.common.stunner.bpmn.definition.UserTask)1 NotificationTypeListValue (org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationTypeListValue)1 NotificationsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.notification.NotificationsInfo)1 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)1 Graph (org.kie.workbench.common.stunner.core.graph.Graph)1