ManagedClassProcessor { static <T> TypeBuilderContext<T> processManagedType(Class<T> cls) { final NamespaceResolver resolver = detectNamespaces(cls); final AbstractIdentifiableType<T> type; if (isEntityType(cls)) { type = processEntityType(cls, resolver); } else if (isMappedSuperclassType(cls)) { type = processMappedSuperclassType(cls); } else { throw new MetamodelInitializationException("Type " + cls + " is not a managed type."); } return new TypeBuilderContext<>(type, resolver); } private  ManagedClassProcessor();   }
@Test void processManagedTypeThrowsInitializationExceptionWhenClassIsMissingNoArgConstructor() { final MetamodelInitializationException ex = assertThrows(MetamodelInitializationException.class, () -> ManagedClassProcessor.processManagedType(ClassWithoutNoArgConstructor.class)); assertEquals("Class " + ClassWithoutNoArgConstructor.class + " is missing required no-arg constructor.", ex.getMessage()); }
@Test void processManagedTypeReturnsEntityTypeForEntity() { final TypeBuilderContext<OWLClassA> res = ManagedClassProcessor.processManagedType(OWLClassA.class); assertTrue(res.getType() instanceof EntityType); }
@Test void processManagedTypeReturnsMappedSuperclassTypeForMappedSuperclass() { final TypeBuilderContext<QMappedSuperclass> res = ManagedClassProcessor .processManagedType(QMappedSuperclass.class); assertTrue(res.getType() instanceof MappedSuperclassType); }