Fixed tests due to changes in the model

This commit is contained in:
Luca Frosini 2020-12-23 10:55:16 +01:00
parent e635cf1a6d
commit e89481a5f1
2 changed files with 7 additions and 10 deletions

View File

@ -63,6 +63,7 @@ import org.gcube.resourcemanagement.model.reference.entities.facets.NetworkingFa
import org.gcube.resourcemanagement.model.reference.entities.facets.SimpleFacet;
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.Actor;
import org.gcube.resourcemanagement.model.reference.entities.resources.Configuration;
import org.gcube.resourcemanagement.model.reference.entities.resources.EService;
import org.gcube.resourcemanagement.model.reference.entities.resources.GCubeResource;
@ -256,16 +257,12 @@ public class ERManagementTest extends ContextTest {
@Test(expected=ResourceRegistryException.class)
public void testCreateAbstractEntity() throws Exception {
StateFacet stateFacet = new StateFacetImpl();
stateFacet.setValue("READY");
FacetManagement facetManagement = new FacetManagement();
facetManagement.setElementType(StateFacet.NAME);
String json = ElementMapper.marshal(stateFacet);
ResourceManagement resourceManagement = new ResourceManagement();
resourceManagement.setElementType(Actor.NAME);
String json = "{\"@class\":\"Actor\",\"header\":null,\"consistsOf\":[{\"@class\":\"IsIdentifiedBy\",\"header\":null,\"propagationConstraint\":{\"@class\":\"PropagationConstraint\",\"remove\":\"cascadeWhenOrphan\",\"add\":\"propagate\"},\"source\":{\"@class\":\"Actor\",\"header\":null},\"target\":{\"@class\":\"ContactFacet\",\"header\":null,\"title\":\"Dr.\",\"name\":\"Frosini\",\"middleName\":null,\"surname\":null,\"eMail\":\"luca.frosini@isti.cnr.it\"}}],\"isRelatedTo\":[]}";
logger.debug(json);
facetManagement.setJson(json);
facetManagement.create();
resourceManagement.setJson(json);
resourceManagement.create();
}
@Test(expected=ResourceRegistryException.class)