From 1cfbcd852951ff373828ba1c5f2eb29ade9e92e2 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Thu, 2 Feb 2023 13:34:57 +0100 Subject: [PATCH] Using new if-model APIs --- .../model/discovery/EntityDiscoveryTest.java | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/src/test/java/org/gcube/informationsystem/model/discovery/EntityDiscoveryTest.java b/src/test/java/org/gcube/informationsystem/model/discovery/EntityDiscoveryTest.java index 4b4db35..5f872ab 100644 --- a/src/test/java/org/gcube/informationsystem/model/discovery/EntityDiscoveryTest.java +++ b/src/test/java/org/gcube/informationsystem/model/discovery/EntityDiscoveryTest.java @@ -1,10 +1,8 @@ package org.gcube.informationsystem.model.discovery; -import java.util.ArrayList; import java.util.List; import java.util.ServiceLoader; -import org.gcube.informationsystem.base.reference.AccessType; import org.gcube.informationsystem.base.reference.Element; import org.gcube.informationsystem.base.reference.entities.EntityElement; import org.gcube.informationsystem.base.reference.properties.PropertyElement; @@ -16,6 +14,7 @@ import org.gcube.informationsystem.types.reference.properties.PropertyDefinition import org.gcube.informationsystem.types.reference.properties.PropertyType; import org.gcube.informationsystem.types.reference.relations.RelationType; import org.gcube.informationsystem.utils.ElementMapper; +import org.gcube.informationsystem.utils.discovery.Discovery; import org.gcube.informationsystem.utils.discovery.ElementSpecilizationDiscovery; import org.gcube.informationsystem.utils.discovery.RegistrationProvider; import org.gcube.informationsystem.utils.discovery.SchemaAction; @@ -61,23 +60,7 @@ public class EntityDiscoveryTest { } }; - List packages = new ArrayList(); - - Class tdClz = Type.class; - packages.add(tdClz.getPackage()); - - AccessType[] accessTypes = AccessType.values(); - for(AccessType accessType : accessTypes) { - Class clz = accessType.getTypeClass(); - packages.add(clz.getPackage()); - } - - ServiceLoader regsitrationProviders = ServiceLoader - .load(RegistrationProvider.class); - for(RegistrationProvider registrationProvider : regsitrationProviders) { - packages.addAll(registrationProvider.getPackagesToRegister()); - } - ElementSpecilizationDiscovery.manageISM(schemaAction, packages); + Discovery.discover(schemaAction); } @Test