View Javadoc

1   package com.atlassian.johnson.event;
2   
3   import com.atlassian.johnson.Johnson;
4   import com.atlassian.johnson.config.ConfigurationJohnsonException;
5   import org.junit.AfterClass;
6   import org.junit.BeforeClass;
7   import org.junit.Test;
8   
9   import static org.junit.Assert.assertEquals;
10  
11  public class EventTypeTest {
12  
13      @BeforeClass
14      public static void initialize() {
15          Johnson.initialize("test-johnson-config.xml");
16      }
17  
18      @AfterClass
19      public static void terminate() {
20          Johnson.terminate();
21      }
22  
23      @Test
24      public void testEventType() {
25          EventType type = new EventType("foo", "bar");
26          assertEquals("foo", type.getType());
27          assertEquals("bar", type.getDescription());
28      }
29  
30      @Test
31      public void testGetEventType() throws ConfigurationJohnsonException {
32          EventType expectedWarning = new EventType("database", "Database");
33          assertEquals(expectedWarning, EventType.get("database"));
34      }
35  }