diff --git a/src/test/java/org/gcube/informationsystem/resourceregistry/instances/multicontext/EnhancedTest.java b/src/test/java/org/gcube/informationsystem/resourceregistry/instances/multicontext/EnhancedTest.java index b702f3e..fcc99e8 100644 --- a/src/test/java/org/gcube/informationsystem/resourceregistry/instances/multicontext/EnhancedTest.java +++ b/src/test/java/org/gcube/informationsystem/resourceregistry/instances/multicontext/EnhancedTest.java @@ -3,6 +3,9 @@ */ package org.gcube.informationsystem.resourceregistry.instances.multicontext; +import java.net.URI; +import java.net.URL; +import java.util.Calendar; import java.util.Collection; import java.util.HashMap; import java.util.Map; @@ -28,13 +31,23 @@ import org.gcube.informationsystem.resourceregistry.instances.model.entities.Fac import org.gcube.informationsystem.resourceregistry.instances.model.entities.ResourceManagement; import org.gcube.informationsystem.resourceregistry.instances.model.relations.IsRelatedToManagement; import org.gcube.informationsystem.utils.ElementMapper; +import org.gcube.resourcemanagement.model.impl.entities.facets.AccessPointFacetImpl; +import org.gcube.resourcemanagement.model.impl.entities.facets.EventFacetImpl; +import org.gcube.resourcemanagement.model.impl.entities.facets.LicenseFacetImpl; import org.gcube.resourcemanagement.model.impl.entities.facets.SoftwareFacetImpl; +import org.gcube.resourcemanagement.model.impl.entities.facets.StateFacetImpl; import org.gcube.resourcemanagement.model.impl.entities.resources.EServiceImpl; +import org.gcube.resourcemanagement.model.impl.properties.ValueSchemaImpl; import org.gcube.resourcemanagement.model.impl.relations.consistsof.IsIdentifiedByImpl; import org.gcube.resourcemanagement.model.impl.relations.isrelatedto.ActivatesImpl; +import org.gcube.resourcemanagement.model.reference.entities.facets.AccessPointFacet; +import org.gcube.resourcemanagement.model.reference.entities.facets.EventFacet; +import org.gcube.resourcemanagement.model.reference.entities.facets.LicenseFacet; import org.gcube.resourcemanagement.model.reference.entities.facets.SoftwareFacet; +import org.gcube.resourcemanagement.model.reference.entities.facets.StateFacet; import org.gcube.resourcemanagement.model.reference.entities.resources.EService; import org.gcube.resourcemanagement.model.reference.entities.resources.HostingNode; +import org.gcube.resourcemanagement.model.reference.properties.ValueSchema; import org.gcube.resourcemanagement.model.reference.relations.consistsof.IsIdentifiedBy; import org.gcube.resourcemanagement.model.reference.relations.isrelatedto.Activates; import org.junit.Assert; @@ -64,8 +77,34 @@ public class EnhancedTest extends MultiContextTest { propagationConstraint.setRemoveConstraint(RemoveConstraint.cascade); IsIdentifiedBy isIdentifiedBy = new IsIdentifiedByImpl( - eService, softwareFacet, null); + eService, softwareFacet, propagationConstraint); eService.addFacet(isIdentifiedBy); + + AccessPointFacet accessPointFacet = new AccessPointFacetImpl(); + accessPointFacet.setEndpoint(new URI("http://localhost")); + accessPointFacet.setEntryName("port1"); + eService.addFacet(accessPointFacet); + + EventFacet eventFacet = new EventFacetImpl(); + eventFacet.setDate(Calendar.getInstance().getTime()); + ValueSchema event = new ValueSchemaImpl(); + event.setValue("Created"); + event.setSchema(new URI("")); + eventFacet.setEvent(event); + eService.addFacet(eventFacet); + + StateFacet stateFacet = new StateFacetImpl(); + stateFacet.setValue("ready"); + eService.addFacet(stateFacet); + + + LicenseFacet licenseFacet = new LicenseFacetImpl(); + licenseFacet.setName("EUPL"); + licenseFacet + .setTextURL(new URL( + "https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11")); + eService.addFacet(licenseFacet); + ResourceManagement resourceManagement = new ResourceManagement(); resourceManagement.setElementType(EService.NAME);