View Javadoc
1   package com.atlassian.plugin.instrumentation;
2   
3   import com.atlassian.instrumentation.InstrumentRegistry;
4   import org.junit.Test;
5   
6   import java.util.Optional;
7   
8   import static com.atlassian.plugin.test.Matchers.notPresent;
9   import static org.hamcrest.MatcherAssert.assertThat;
10  import static org.hamcrest.Matchers.notNullValue;
11  import static org.hamcrest.core.Is.is;
12  import static org.mockito.Mockito.mock;
13  import static org.mockito.Mockito.verify;
14  
15  public class TestPluginSystemInstrumentationDisabled {
16  
17      private final PluginSystemInstrumentation pluginSystemInstrumentation = new PluginSystemInstrumentation();
18  
19      @Test
20      public void instrumentationNotCreated() {
21          final Optional<InstrumentRegistry> instrumentRegistry = pluginSystemInstrumentation.getInstrumentRegistry();
22          assertThat(instrumentRegistry, notPresent());
23      }
24  
25      @Test
26      public void pullTimerReturnsEmpty() {
27          final Timer timer = pluginSystemInstrumentation.pullTimer("sometimer");
28          assertThat(timer, notNullValue());
29          assertThat(timer.getOpTimer(), notPresent());
30      }
31  
32      @Test
33      public void pullSingleTimerReturnsEmpty() {
34          final Timer timer = pluginSystemInstrumentation.pullSingleTimer("somesingletimer");
35          assertThat(timer, notNullValue());
36          assertThat(timer.getOpTimer(), notPresent());
37      }
38  }