Added test

This commit is contained in:
Luca Frosini 2023-05-15 16:49:51 +02:00
parent a73c69c1f1
commit b35fdc003a
1 changed files with 10 additions and 0 deletions

View File

@ -3,8 +3,11 @@
*/
package org.gcube.resourcemanagement.model.reference.entities.facets;
import java.io.IOException;
import java.util.List;
import org.gcube.com.fasterxml.jackson.core.JsonParseException;
import org.gcube.com.fasterxml.jackson.databind.JsonMappingException;
import org.gcube.informationsystem.base.reference.Element;
import org.gcube.informationsystem.base.reference.IdentifiableElement;
import org.gcube.informationsystem.model.impl.properties.MetadataImpl;
@ -99,4 +102,11 @@ public class PolymorphismTest {
logger.debug(string);
}
public static final String AUX = "{\"type\":\"Activates\",\"id\":\"6f727f32-4c2d-477f-997b-1f792168875f\",\"propagationConstraint\":{\"type\":\"PropagationConstraint\",\"add\":\"propagate\",\"delete\":\"cascade\",\"remove\":\"cascade\"},\"source\":{\"type\":\"HostingNode\",\"supertypes\":[\"Service\",\"GCubeResource\",\"Resource\"],\"id\":\"1c7e980d-cbd0-4a97-a7b7-2e6f530864c4\"},\"target\":{\"type\":\"EService\",\"id\":\"18854a80-7f72-4655-82cc-22884c912bfe\",\"consistsOf\":[{\"type\":\"IsIdentifiedBy\",\"id\":null,\"propagationConstraint\":{\"type\":\"PropagationConstraint\",\"add\":\"propagate\",\"delete\":\"cascade\",\"remove\":\"cascade\"},\"source\":{\"type\":\"EService\",\"id\":\"18854a80-7f72-4655-82cc-22884c912bfe\"},\"target\":{\"type\":\"SoftwareFacet\",\"id\":null,\"name\":\"gcat\",\"group\":\"org.gcube.data-catalogue\",\"version\":\"2.5.1-SNAPSHOT\",\"description\":\"This service allows any client to publish on the gCube Catalogue.\",\"qualifier\":null,\"optional\":false}},{\"type\":\"ConsistsOf\",\"id\":null,\"propagationConstraint\":{\"type\":\"PropagationConstraint\",\"add\":\"propagate\",\"delete\":\"cascade\",\"remove\":\"cascade\"},\"source\":{\"type\":\"EService\",\"id\":\"18854a80-7f72-4655-82cc-22884c912bfe\"},\"target\":{\"type\":\"AccessPointFacet\",\"id\":null,\"entryName\":\"org.gcube.gcat.ResourceInitializer\",\"endpoint\":\"http://gcat.dev.int.d4science.net:80/gcat\",\"protocol\":null,\"description\":null,\"authorization\":{\"type\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null}}},{\"type\":\"ConsistsOf\",\"id\":null,\"propagationConstraint\":{\"type\":\"PropagationConstraint\",\"add\":\"propagate\",\"delete\":\"cascade\",\"remove\":\"cascade\"},\"source\":{\"type\":\"EService\",\"id\":\"18854a80-7f72-4655-82cc-22884c912bfe\"},\"target\":{\"type\":\"AccessPointFacet\",\"id\":null,\"entryName\":\"gcat-remote-management\",\"endpoint\":\"http://gcat.dev.int.d4science.net:80/gcat/gcube/resource\",\"protocol\":null,\"description\":null,\"authorization\":{\"type\":\"ValueSchema\",\"value\":\"gcube-token\",\"schema\":null}}},{\"type\":\"ConsistsOf\",\"id\":null,\"propagationConstraint\":{\"type\":\"PropagationConstraint\",\"add\":\"propagate\",\"delete\":\"cascade\",\"remove\":\"cascade\"},\"source\":{\"type\":\"EService\",\"id\":\"18854a80-7f72-4655-82cc-22884c912bfe\"},\"target\":{\"type\":\"StateFacet\",\"id\":null,\"value\":\"started\",\"date\":\"2023-05-15 12:36:47.299 +0200\"}},{\"type\":\"ConsistsOf\",\"id\":null,\"propagationConstraint\":{\"type\":\"PropagationConstraint\",\"add\":\"propagate\",\"delete\":\"cascade\",\"remove\":\"cascade\"},\"source\":{\"type\":\"EService\",\"id\":\"18854a80-7f72-4655-82cc-22884c912bfe\"},\"target\":{\"type\":\"EventFacet\",\"id\":null,\"date\":\"2023-05-15 10:36:47.299 +0000\",\"event\":\"started\"}}],\"isRelatedTo\":[]}}";
@Test
public void testUnmarshalling() throws JsonParseException, JsonMappingException, IOException {
ElementMapper.unmarshal(Activates.class, AUX);
}
}