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      {
16          Johnson.initialize("test-johnson-config.xml");
17      }
18  
19      @AfterClass
20      public static void terminate()
21      {
22          Johnson.terminate();
23      }
24  
25      @Test
26      public void testEventType()
27      {
28          EventType type = new EventType("foo", "bar");
29          assertEquals("foo", type.getType());
30          assertEquals("bar", type.getDescription());
31      }
32  
33      @Test
34      public void testGetEventType() throws ConfigurationJohnsonException
35      {
36          EventType expectedWarning = new EventType("database", "Database");
37          assertEquals(expectedWarning, EventType.get("database"));
38      }
39  }