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 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 {
|
public class EntityMetaTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void ensureRegistration() throws IllegalAccessException {
|
public void ensureRegistration() throws IllegalAccessException {
|
||||||
var fields = EntityTypes.class.getDeclaredFields();
|
List<String> list = new ArrayList<>();
|
||||||
for (var field : fields) {
|
for (var field : EntityTypes.class.getDeclaredFields()) {
|
||||||
EntityType entityType = (EntityType) field.get(this);
|
final EntityType entityType = (EntityType) field.get(this);
|
||||||
assertNotNull(EntityTypeImpl.ENTITY_META_SUPPLIER.get(entityType.name()), "Meta for " + entityType.name() + " is null");
|
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