diff --git a/telemetry_core/src/test/java/com/newrelic/telemetry/events/EventTest.java b/telemetry_core/src/test/java/com/newrelic/telemetry/events/EventTest.java new file mode 100644 index 00000000..24830737 --- /dev/null +++ b/telemetry_core/src/test/java/com/newrelic/telemetry/events/EventTest.java @@ -0,0 +1,29 @@ +package com.newrelic.telemetry.events; + +import com.newrelic.telemetry.Attributes; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +public class EventTest { + + @Test + void testNullEventType() { + assertThrows( + IllegalArgumentException.class, + () -> { + new Event( + new Event(null, new Attributes().put("key1", "val1"), System.currentTimeMillis())); + }); + } + + @Test + void testEmptyStringEventType() { + assertThrows( + IllegalArgumentException.class, + () -> { + new Event( + new Event("", new Attributes().put("key2", "val2"), System.currentTimeMillis())); + }); + } +}