private MetricRegistry getMockMetricRegistry() {
final MetricRegistry mockMetricRegistry = mock(MetricRegistry.class);
final Meter mockMeter = mock(Meter.class);
final Timer mockTimer = mock(Timer.class);
final Counter mockCounter = mock(Counter.class);
when(mockMetricRegistry.meter(anyString())).thenReturn(mockMeter);
when(mockMetricRegistry.timer(anyString())).thenReturn(mockTimer);
when(mockMetricRegistry.counter(anyString())).thenReturn(mockCounter);
return mockMetricRegistry;
}