View Javadoc
1   package com.atlassian.plugin.event.events;
2   
3   import com.atlassian.plugin.PluginAccessor;
4   import com.atlassian.plugin.PluginController;
5   import org.junit.Test;
6   import org.junit.runner.RunWith;
7   import org.mockito.Mock;
8   import org.mockito.junit.MockitoJUnitRunner;
9   
10  import static org.hamcrest.MatcherAssert.assertThat;
11  import static org.hamcrest.Matchers.is;
12  
13  @RunWith(MockitoJUnitRunner.class)
14  public class TestPluginFrameworkEvents {
15      @Mock
16      private PluginController pluginController;
17      @Mock
18      private PluginAccessor pluginAccessor;
19  
20      @Test
21      public void pluginFrameworkDelayedEventGetters() {
22          final PluginFrameworkDelayedEvent pluginFrameworkDelayedEvent =
23                  new PluginFrameworkDelayedEvent(pluginController, pluginAccessor);
24          assertThat(pluginFrameworkDelayedEvent.getPluginAccessor(), is(pluginAccessor));
25          assertThat(pluginFrameworkDelayedEvent.getPluginController(), is(pluginController));
26      }
27  
28      @Test
29      public void pluginFrameworkResumingEventGetters() {
30          final PluginFrameworkResumingEvent pluginFrameworkResumingEvent =
31                  new PluginFrameworkResumingEvent(pluginController, pluginAccessor);
32          assertThat(pluginFrameworkResumingEvent.getPluginAccessor(), is(pluginAccessor));
33          assertThat(pluginFrameworkResumingEvent.getPluginController(), is(pluginController));
34      }
35  
36      @Test
37      public void pluginFrameworkShutdownEventGetters() {
38          final PluginFrameworkShutdownEvent pluginFrameworkShutdownEvent =
39                  new PluginFrameworkShutdownEvent(pluginController, pluginAccessor);
40          assertThat(pluginFrameworkShutdownEvent.getPluginAccessor(), is(pluginAccessor));
41          assertThat(pluginFrameworkShutdownEvent.getPluginController(), is(pluginController));
42      }
43  
44      @Test
45      public void pluginFrameworkShuttingDownEventGetters() {
46          final PluginFrameworkShuttingDownEvent pluginFrameworkShuttingDownEvent =
47                  new PluginFrameworkShuttingDownEvent(pluginController, pluginAccessor);
48          assertThat(pluginFrameworkShuttingDownEvent.getPluginAccessor(), is(pluginAccessor));
49          assertThat(pluginFrameworkShuttingDownEvent.getPluginController(), is(pluginController));
50      }
51  
52      @Test
53      public void pluginFrameworkStartedEventGetters() {
54          final PluginFrameworkStartedEvent pluginFrameworkStartedEvent =
55                  new PluginFrameworkStartedEvent(pluginController, pluginAccessor);
56          assertThat(pluginFrameworkStartedEvent.getPluginAccessor(), is(pluginAccessor));
57          assertThat(pluginFrameworkStartedEvent.getPluginController(), is(pluginController));
58      }
59  
60      @Test
61      public void pluginFrameworkStartingEventGetters() {
62          final PluginFrameworkStartingEvent pluginFrameworkStartingEvent =
63                  new PluginFrameworkStartingEvent(pluginController, pluginAccessor);
64          assertThat(pluginFrameworkStartingEvent.getPluginAccessor(), is(pluginAccessor));
65          assertThat(pluginFrameworkStartingEvent.getPluginController(), is(pluginController));
66      }
67  
68      @Test
69      public void pluginFrameworkWarmRestartedEventGetters() {
70          final PluginFrameworkWarmRestartedEvent pluginFrameworkWarmRestartedEvent =
71                  new PluginFrameworkWarmRestartedEvent(pluginController, pluginAccessor);
72          assertThat(pluginFrameworkWarmRestartedEvent.getPluginAccessor(), is(pluginAccessor));
73          assertThat(pluginFrameworkWarmRestartedEvent.getPluginController(), is(pluginController));
74      }
75  
76      @Test
77      public void pluginFrameworkWarmRestartingEventGetters() {
78          final PluginFrameworkWarmRestartingEvent pluginFrameworkWarmRestartingEvent =
79                  new PluginFrameworkWarmRestartingEvent(pluginController, pluginAccessor);
80          assertThat(pluginFrameworkWarmRestartingEvent.getPluginAccessor(), is(pluginAccessor));
81          assertThat(pluginFrameworkWarmRestartingEvent.getPluginController(), is(pluginController));
82      }
83  }