dnet-hadoop/dhp-schemas/src/test/java/eu/dnetlib/dhp/schema/common/ModelSupportTest.java

38 lines
837 B
Java
Raw Normal View History

2020-04-30 11:05:17 +02:00
package eu.dnetlib.dhp.schema.common;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
2020-04-30 11:05:17 +02:00
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import eu.dnetlib.dhp.schema.oaf.OafEntity;
import eu.dnetlib.dhp.schema.oaf.Relation;
import eu.dnetlib.dhp.schema.oaf.Result;
public class ModelSupportTest {
2020-04-30 11:05:17 +02:00
@Nested
class IsSubClass {
2020-04-30 11:05:17 +02:00
@Test
public void shouldReturnFalseWhenSubClassDoesNotExtendSuperClass() {
// when
Boolean result = ModelSupport.isSubClass(Relation.class, OafEntity.class);
2020-04-30 11:05:17 +02:00
// then
assertFalse(result);
}
2020-04-30 11:05:17 +02:00
@Test
public void shouldReturnTrueWhenSubClassExtendsSuperClass() {
// when
Boolean result = ModelSupport.isSubClass(Result.class, OafEntity.class);
2020-04-30 11:05:17 +02:00
// then
assertTrue(result);
}
}
}