use of com.puppycrawl.tools.checkstyle.utils.TokenUtil in project checkstyle by checkstyle.
the class TokenTypesTest method testAllTokenTypesHasDescription.
@Test
public void testAllTokenTypesHasDescription() {
final String tokenTypes = "com.puppycrawl.tools.checkstyle.api.tokentypes";
final ResourceBundle bundle = ResourceBundle.getBundle(tokenTypes, Locale.ROOT);
final Set<String> expected = Arrays.stream(TokenUtil.getAllTokenIds()).mapToObj(TokenUtil::getTokenName).filter(name -> name.charAt(0) != '$').collect(Collectors.toSet());
final Set<String> actual = bundle.keySet();
assertWithMessage("TokenTypes without description").that(actual).isEqualTo(expected);
}
Aggregations