test_class.declarator: strategy
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private TimingStrategy strategy;
test_class.type: TimingStrategy
test_class.var_name: strategy
test_class.declarator: config
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Config config;
test_class.type: Config
test_class.var_name: config
test_class.declarator: strategyConfig
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Config strategyConfig;
test_class.type: Config
test_class.var_name: strategyConfig
test_class.declarator: service
test_class.modifier: private
test_class.original_string: private DefaultMetricsService service;
test_class.type: DefaultMetricsService
test_class.var_name: service
test_class.file: metrics/core/src/test/java/org/microbule/metrics/core/DefaultMetricsServiceTest.java
test_class.identifier: DefaultMetricsServiceTest
test_class.superclass: extends MockObjectTestCase
test_case.body: @Test
      public void testCreateTimer() {
          when(config.filtered("mockStrategy")).thenReturn(strategyConfig);
  
          final Timer timer = service.createTimer("foo", "mockStrategy", config);
          assertNotNull(timer);
  
          assertNotNull(service.getRegistry());
          verify(strategy, times(2)).name();
          verify(strategy).createTimer(strategyConfig);
          Mockito.verifyNoMoreInteractions(strategy);
      }
test_case.class_method_signature: DefaultMetricsServiceTest.testCreateTimer()
test_case.full_signature: @Test public void testCreateTimer()
test_case.identifier: testCreateTimer
test_case.invocations: thenReturn when filtered createTimer assertNotNull assertNotNull getRegistry name verify times createTimer verify verifyNoMoreInteractions
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCreateTimer()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(DefaultMetricsService.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(DefaultMetricsService.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: registry = new MetricRegistry()
focal_class.modifier: private final
focal_class.original_string: private final MetricRegistry registry = new MetricRegistry();
focal_class.type: MetricRegistry
focal_class.var_name: registry
focal_class.declarator: timingStrategies
focal_class.modifier: private final
focal_class.original_string: private final Map<String, TimingStrategy> timingStrategies;
focal_class.type: Map<String, TimingStrategy>
focal_class.var_name: timingStrategies
focal_class.file: metrics/core/src/main/java/org/microbule/metrics/core/DefaultMetricsService.java
focal_class.identifier: DefaultMetricsService
focal_class.interfaces: implements MetricsService
focal_class.class_method_signature: DefaultMetricsService.DefaultMetricsService(MicrobuleContainer container)
focal_class.full_signature: @Inject public  DefaultMetricsService(MicrobuleContainer container)
focal_class.identifier: DefaultMetricsService
focal_class.modifiers: @Inject public
focal_class.parameters: (MicrobuleContainer container)
focal_class.signature:  DefaultMetricsService(MicrobuleContainer container)
focal_class.class_method_signature: DefaultMetricsService.createTimer(String name, String timingStrategyName, Config config)
focal_class.full_signature: @Override public Timer createTimer(String name, String timingStrategyName, Config config)
focal_class.identifier: createTimer
focal_class.modifiers: @Override public
focal_class.parameters: (String name, String timingStrategyName, Config config)
focal_class.return: Timer
focal_class.signature: Timer createTimer(String name, String timingStrategyName, Config config)
focal_class.class_method_signature: DefaultMetricsService.getRegistry()
focal_class.full_signature: @Override public MetricRegistry getRegistry()
focal_class.identifier: getRegistry
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: MetricRegistry
focal_class.signature: MetricRegistry getRegistry()
focal_method.body: @Override
      public Timer createTimer(String name, String timingStrategyName, Config config) {
          return registry.timer(name, () -> {
              TimingStrategy strategy = timingStrategies.get(timingStrategyName);
              if (strategy == null) {
                  LOGGER.warn("Timing strategy \"{}\" not found, using default instead.", timingStrategyName);
                  strategy = DefaultTimingStrategy.INSTANCE;
              }
              return strategy.createTimer(config.filtered(strategy.name()));
          });
      }
focal_method.class_method_signature: DefaultMetricsService.createTimer(String name, String timingStrategyName, Config config)
focal_method.full_signature: @Override public Timer createTimer(String name, String timingStrategyName, Config config)
focal_method.identifier: createTimer
focal_method.invocations: timer get warn createTimer filtered name
focal_method.modifiers: @Override public
focal_method.parameters: (String name, String timingStrategyName, Config config)
focal_method.return: Timer
focal_method.signature: Timer createTimer(String name, String timingStrategyName, Config config)