Search in sources :

Example 1 with AbstractDataEvent

use of org.kie.kogito.event.AbstractDataEvent in project kogito-runtimes by kiegroup.

the class CloudEventUtilsTest method testGetAttribute.

@Test
void testGetAttribute() {
    AbstractDataEvent event = new AbstractDataEvent("TestType", "source", null, "kogitoProcessinstanceId", "kogitoRootProcessId", "kogitoProcessId", "kogitoRootProcessId", "kogitoAddons") {
    };
    assertThat(CloudEventUtils.getAttribute("type", event)).isEqualTo("TestType");
    assertThat(CloudEventUtils.getAttribute("source", event)).isInstanceOf(URI.class);
    assertThat(CloudEventUtils.getAttribute("data", event)).isNull();
    assertThat(CloudEventUtils.getAttribute("wrongValue", event)).isNull();
}
Also used : AbstractDataEvent(org.kie.kogito.event.AbstractDataEvent) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 AbstractDataEvent (org.kie.kogito.event.AbstractDataEvent)1