@DataProvider(value = {
"null | _ | foo_bar | single",
"somePrefix | _ | somePrefix.foo_bar | somePrefix.single",
"null | - | foo-bar | single",
"other.Prefix | weirddelimiter | other.Prefix.fooweirddelimiterbar | other.Prefix.single",
" | | foobar | single",
"null | null | foobar | single",
"yetMorePrefix | null | yetMorePrefix.foobar | yetMorePrefix.single"
}, splitBy = "\\|")
@Test
public void defaultMetricNamingStrategy_works_as_expected(
String prefix, String wordDelimiter, String expectedFooBarName, String expectedSingleName
) {
DefaultMetricNamingStrategy<FooMetricName> strat = new DefaultMetricNamingStrategy<>(prefix, wordDelimiter);
String actualFooBarName = strat.nameFor(FooMetricName.FOO_BAR);
String actualSingleName = strat.nameFor(FooMetricName.SINGLE);
assertThat(actualFooBarName).isEqualTo(expectedFooBarName);
assertThat(actualSingleName).isEqualTo(expectedSingleName);
}