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);
}
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);
}
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);
}
Aggregations