Search in sources :

Example 1 with MetricNamingStrategy

use of com.nike.riposte.metrics.codahale.CodahaleMetricsListener.MetricNamingStrategy in project riposte by Nike-Inc.

the class CodahaleMetricsListenerTest method metricNamingStrategy_defaultNoPrefixImpl_method_works_as_expected.

@Test
public void metricNamingStrategy_defaultNoPrefixImpl_method_works_as_expected() {
    // when
    MetricNamingStrategy result = MetricNamingStrategy.defaultNoPrefixImpl();
    // then
    assertThat(result).isInstanceOf(DefaultMetricNamingStrategy.class);
    DefaultMetricNamingStrategy defStrat = (DefaultMetricNamingStrategy) result;
    assertThat(defStrat.prefix).isEqualTo(null);
    assertThat(defStrat.wordDelimiter).isEqualTo(DEFAULT_WORD_DELIMITER);
}
Also used : DefaultMetricNamingStrategy(com.nike.riposte.metrics.codahale.CodahaleMetricsListener.DefaultMetricNamingStrategy) MetricNamingStrategy(com.nike.riposte.metrics.codahale.CodahaleMetricsListener.MetricNamingStrategy) DefaultMetricNamingStrategy(com.nike.riposte.metrics.codahale.CodahaleMetricsListener.DefaultMetricNamingStrategy) Test(org.junit.Test)

Example 2 with MetricNamingStrategy

use of com.nike.riposte.metrics.codahale.CodahaleMetricsListener.MetricNamingStrategy in project riposte by Nike-Inc.

the class CodahaleMetricsListenerTest method metricNamingStrategy_defaultImpl_no_args_method_works_as_expected.

@Test
public void metricNamingStrategy_defaultImpl_no_args_method_works_as_expected() {
    // when
    MetricNamingStrategy result = MetricNamingStrategy.defaultImpl();
    // then
    assertThat(result).isInstanceOf(DefaultMetricNamingStrategy.class);
    DefaultMetricNamingStrategy defStrat = (DefaultMetricNamingStrategy) result;
    assertThat(defStrat.prefix).isEqualTo(DEFAULT_PREFIX);
    assertThat(defStrat.wordDelimiter).isEqualTo(DEFAULT_WORD_DELIMITER);
}
Also used : DefaultMetricNamingStrategy(com.nike.riposte.metrics.codahale.CodahaleMetricsListener.DefaultMetricNamingStrategy) MetricNamingStrategy(com.nike.riposte.metrics.codahale.CodahaleMetricsListener.MetricNamingStrategy) DefaultMetricNamingStrategy(com.nike.riposte.metrics.codahale.CodahaleMetricsListener.DefaultMetricNamingStrategy) Test(org.junit.Test)

Example 3 with MetricNamingStrategy

use of com.nike.riposte.metrics.codahale.CodahaleMetricsListener.MetricNamingStrategy in project riposte by Nike-Inc.

the class CodahaleMetricsListenerTest method metricNamingStrategy_defaultImpl_with_args_method_works_as_expected.

@Test
public void metricNamingStrategy_defaultImpl_with_args_method_works_as_expected() {
    // given
    String prefix = UUID.randomUUID().toString();
    String wordDelimiter = UUID.randomUUID().toString();
    // when
    MetricNamingStrategy result = MetricNamingStrategy.defaultImpl(prefix, wordDelimiter);
    // then
    assertThat(result).isInstanceOf(DefaultMetricNamingStrategy.class);
    DefaultMetricNamingStrategy defStrat = (DefaultMetricNamingStrategy) result;
    assertThat(defStrat.prefix).isEqualTo(prefix);
    assertThat(defStrat.wordDelimiter).isEqualTo(wordDelimiter);
}
Also used : DefaultMetricNamingStrategy(com.nike.riposte.metrics.codahale.CodahaleMetricsListener.DefaultMetricNamingStrategy) MetricNamingStrategy(com.nike.riposte.metrics.codahale.CodahaleMetricsListener.MetricNamingStrategy) DefaultMetricNamingStrategy(com.nike.riposte.metrics.codahale.CodahaleMetricsListener.DefaultMetricNamingStrategy) Matchers.anyString(org.mockito.Matchers.anyString) Test(org.junit.Test)

Aggregations

DefaultMetricNamingStrategy (com.nike.riposte.metrics.codahale.CodahaleMetricsListener.DefaultMetricNamingStrategy)3 MetricNamingStrategy (com.nike.riposte.metrics.codahale.CodahaleMetricsListener.MetricNamingStrategy)3 Test (org.junit.Test)3 Matchers.anyString (org.mockito.Matchers.anyString)1