test: Remove auto transient test

This commit is contained in:
2025-09-20 21:44:54 +02:00
parent e9ffb5d29f
commit 9351b8453d

View File

@ -1,34 +0,0 @@
package cz.jzitnik.game.core.autotransient;
import cz.jzitnik.game.annotations.AutoTransient;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.reflections.Reflections;
import org.reflections.scanners.Scanners;
import org.reflections.util.ConfigurationBuilder;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Set;
import static org.junit.jupiter.api.Assertions.*;
class AutoTransientSupportTest {
@Test
@DisplayName("All fields annotated with @AutoTransient must be transient.")
void checkAutoTransientAnnotation() {
Reflections reflections = new Reflections(
new ConfigurationBuilder()
.forPackages("cz.jzitnik.game")
.addScanners(Scanners.FieldsAnnotated)
);
Set<Field> fields = reflections.getFieldsAnnotatedWith(AutoTransient.class);
for (Field field : fields) {
if (!Modifier.isTransient(field.getModifiers())) {
fail("Field '" + field.getName() + "' in class " + field.getClass().getName() +
" is annotated with @AutoTransient but is not transient.");
}
}
}
}