public class RelatesToTest extends TestCase {
public void testRelatesToIsSet() {
try {
boolean failed = false;
final ReflectionHelper reflectionHelper = new CachingReflectionHelper();
for (final Class<? extends AbstractEntity> clazz : ReflectionHelper.getClasses("honeycrm.server.domain")) {
if (Modifier.isAbstract(clazz.getModifiers())) {
continue;
}
for (final Field field : reflectionHelper.getAllFields(clazz)) {
final boolean isLong = Long.class.equals(field.getType()) || long.class.equals(field.getType());
final boolean hasCorrectName = field.getName().toLowerCase().contains("id");
final boolean isAnnotated = field.isAnnotationPresent(FieldRelateAnnotation.class);
if (isLong && hasCorrectName && !isAnnotated) {