Fixing test
This commit is contained in:
parent
132f9c51c6
commit
c443ae8c4e
|
@ -1,5 +1,8 @@
|
||||||
package org.gcube.informationsystem.resourceregistry.instances.multicontext;
|
package org.gcube.informationsystem.resourceregistry.instances.multicontext;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.gcube.informationsystem.model.reference.entities.Facet;
|
import org.gcube.informationsystem.model.reference.entities.Facet;
|
||||||
|
@ -9,11 +12,21 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resour
|
||||||
import org.gcube.informationsystem.resourceregistry.instances.model.entities.FacetManagement;
|
import org.gcube.informationsystem.resourceregistry.instances.model.entities.FacetManagement;
|
||||||
import org.gcube.informationsystem.resourceregistry.instances.model.entities.ResourceManagement;
|
import org.gcube.informationsystem.resourceregistry.instances.model.entities.ResourceManagement;
|
||||||
import org.gcube.informationsystem.utils.ElementMapper;
|
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.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.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.consistsof.IsIdentifiedByImpl;
|
||||||
|
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.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.EService;
|
||||||
|
import org.gcube.resourcemanagement.model.reference.properties.ValueSchema;
|
||||||
import org.gcube.resourcemanagement.model.reference.relations.consistsof.IsIdentifiedBy;
|
import org.gcube.resourcemanagement.model.reference.relations.consistsof.IsIdentifiedBy;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -39,6 +52,29 @@ public class RuleTest extends ContextTest {
|
||||||
eService, softwareFacet, null);
|
eService, softwareFacet, null);
|
||||||
eService.addFacet(isIdentifiedBy);
|
eService.addFacet(isIdentifiedBy);
|
||||||
|
|
||||||
|
AccessPointFacet accessPointFacet = new AccessPointFacetImpl();
|
||||||
|
accessPointFacet.setEndpoint(new URI("https://localhost"));
|
||||||
|
accessPointFacet.setEntryName("port1");
|
||||||
|
eService.addFacet(accessPointFacet);
|
||||||
|
|
||||||
|
EventFacet eventFacet = new EventFacetImpl();
|
||||||
|
eventFacet.setDate(Calendar.getInstance().getTime());
|
||||||
|
ValueSchema event = new ValueSchemaImpl();
|
||||||
|
event.setValue("Created");
|
||||||
|
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 resourceManagement = new ResourceManagement();
|
||||||
resourceManagement.setElementType(EService.NAME);
|
resourceManagement.setElementType(EService.NAME);
|
||||||
resourceManagement.setJson(ElementMapper.marshal(eService));
|
resourceManagement.setJson(ElementMapper.marshal(eService));
|
||||||
|
|
Loading…
Reference in New Issue