mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-02 11:21:15 +01:00
Store all missing entity meta in test
This commit is contained in:
parent
8cf598d290
commit
058e645c33
@ -2,16 +2,23 @@ package net.minestom.server.entity;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
public class EntityMetaTest {
|
||||
|
||||
@Test
|
||||
public void ensureRegistration() throws IllegalAccessException {
|
||||
var fields = EntityTypes.class.getDeclaredFields();
|
||||
for (var field : fields) {
|
||||
EntityType entityType = (EntityType) field.get(this);
|
||||
assertNotNull(EntityTypeImpl.ENTITY_META_SUPPLIER.get(entityType.name()), "Meta for " + entityType.name() + " is null");
|
||||
List<String> list = new ArrayList<>();
|
||||
for (var field : EntityTypes.class.getDeclaredFields()) {
|
||||
final EntityType entityType = (EntityType) field.get(this);
|
||||
final String name = entityType.name();
|
||||
if (EntityTypeImpl.ENTITY_META_SUPPLIER.get(name) == null) {
|
||||
list.add(name);
|
||||
}
|
||||
}
|
||||
assertTrue(list.isEmpty(), "Missing meta for: " + list);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user