SPIGOT-7267: Fix EntityType#getTranslationKey() and add unit test

By: Doc <nachito94@msn.com>
This commit is contained in:
CraftBukkit/Spigot
2023-02-20 19:35:39 +11:00
parent b83c3d9c17
commit 412e157d39
2 changed files with 12 additions and 1 deletions

View File

@@ -27,4 +27,14 @@ public class EntityTypesTest extends AbstractTestingBase {
Assert.assertTrue("Unmapped bukkit entities " + allBukkit, allBukkit.isEmpty());
}
@Test
public void testTranslationKey() {
for (EntityType entityType : EntityType.values()) {
// Currently EntityType#getTranslationKey has a validation for null name then for test skip this and check correct names.
if (entityType.getName() != null) {
Assert.assertNotNull("Nulllable translation key for " + entityType, entityType.getTranslationKey());
}
}
}
}