2023-02-01 16:24:35 +01:00
|
|
|
|
|
|
|
package eu.dnetlib.dhp.schema.oaf.common;
|
|
|
|
|
2023-02-09 12:32:28 +01:00
|
|
|
import static org.junit.jupiter.api.Assertions.*;
|
2023-02-01 16:24:35 +01:00
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
2023-02-09 12:32:28 +01:00
|
|
|
import org.junit.jupiter.api.Nested;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
|
|
|
import eu.dnetlib.dhp.schema.oaf.Entity;
|
|
|
|
import eu.dnetlib.dhp.schema.oaf.Relation;
|
|
|
|
import eu.dnetlib.dhp.schema.oaf.Result;
|
2023-02-01 16:24:35 +01:00
|
|
|
|
|
|
|
public class ModelSupportTest {
|
|
|
|
|
|
|
|
@Nested
|
|
|
|
class IsSubClass {
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void shouldReturnFalseWhenSubClassDoesNotExtendSuperClass() {
|
|
|
|
// when
|
|
|
|
Boolean result = ModelSupport.isSubClass(Relation.class, Entity.class);
|
|
|
|
|
|
|
|
// then
|
|
|
|
assertFalse(result);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void shouldReturnTrueWhenSubClassExtendsSuperClass() {
|
|
|
|
// when
|
|
|
|
Boolean result = ModelSupport.isSubClass(Result.class, Entity.class);
|
|
|
|
|
|
|
|
// then
|
|
|
|
assertTrue(result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|