Skip to content

Commit

Permalink
tests for eventType check
Browse files Browse the repository at this point in the history
  • Loading branch information
tbradellis committed Aug 26, 2020
1 parent e741e4d commit e50e908
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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()));
});
}
}

0 comments on commit e50e908

Please sign in to comment.