Skip to content

Commit

Permalink
add tests that check for IAE when using a an illegal tag name; not co…
Browse files Browse the repository at this point in the history
…mprehensive test of all api and annotation calls
  • Loading branch information
Channyboy committed Aug 31, 2022
1 parent 96af76b commit 7c9e6a8
Showing 1 changed file with 34 additions and 0 deletions.
Expand Up @@ -228,4 +228,38 @@ public void nonMatchingTagTest3() {
fail("No exception was caught");

}

@Test
@InSequence(9)
public void illegalMpScopeTag() {
Tag mpScopeTag = new Tag("mp_scope", "aScope");

try {
registry.histogram("someHistogram", mpScopeTag);

} catch (Exception cause) {
assertThat(cause, is(Matchers.<Exception>instanceOf(IllegalArgumentException.class)));
return;
}

fail("No exception was caught");

}

@Test
@InSequence(10)
public void illegalMpAppTag() {
Tag mpAppTag = new Tag("mp_app", "anApp");

try {
registry.counter("someCounter", mpAppTag);

} catch (Exception cause) {
assertThat(cause, is(Matchers.<Exception>instanceOf(IllegalArgumentException.class)));
return;
}

fail("No exception was caught");

}
}

0 comments on commit 7c9e6a8

Please sign in to comment.