From 21834543fd0cc50e25057c0815285650372d1862 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Thu, 12 Jan 2017 15:46:32 +0000 Subject: [PATCH] Fixing test git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry-publisher@141532 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../publisher/SmartgearResourcesTest.java | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/gcube/informationsystem/resourceregistry/publisher/SmartgearResourcesTest.java b/src/test/java/org/gcube/informationsystem/resourceregistry/publisher/SmartgearResourcesTest.java index 6b78806..9206b28 100644 --- a/src/test/java/org/gcube/informationsystem/resourceregistry/publisher/SmartgearResourcesTest.java +++ b/src/test/java/org/gcube/informationsystem/resourceregistry/publisher/SmartgearResourcesTest.java @@ -53,6 +53,7 @@ import org.gcube.informationsystem.model.relation.consistsof.HasVolatileMemory; import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException; import org.gcube.informationsystem.resourceregistry.publisher.proxy.ResourceRegistryPublisher; import org.gcube.informationsystem.resourceregistry.publisher.proxy.ResourceRegistryPublisherFactory; +import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -85,6 +86,12 @@ public class SmartgearResourcesTest extends ScopedTest { hostingNode = resourceRegistryPublisher.createResource(HostingNode.class, hostingNode); logger.debug("Created : {}", hostingNode); + Assert.assertTrue(hostingNode!=null); + Assert.assertTrue(hostingNode.getHeader()!=null); + Assert.assertTrue(hostingNode.getHeader().getUUID()!=null); + + boolean deleted = resourceRegistryPublisher.deleteResource(hostingNode); + Assert.assertTrue(deleted); } @Test @@ -94,6 +101,14 @@ public class SmartgearResourcesTest extends ScopedTest { eService = resourceRegistryPublisher.createResource(EService.class, eService); logger.debug("Created : {}", eService); + + Assert.assertTrue(eService!=null); + Assert.assertTrue(eService.getHeader()!=null); + Assert.assertTrue(eService.getHeader().getUUID()!=null); + + boolean deleted = resourceRegistryPublisher.deleteResource(eService); + Assert.assertTrue(deleted); + } @@ -206,9 +221,12 @@ public class SmartgearResourcesTest extends ScopedTest { consistsOfList.removeAll(consistsOfToRemove); - HostingNode hostingNodeToUpdated = resourceRegistryPublisher.updateResource(HostingNode.class, hostingNodeToUpdate); - logger.debug("Upodate Hosting Node {}", hostingNodeToUpdated); + HostingNode updatedHostingNode = resourceRegistryPublisher.updateResource(HostingNode.class, hostingNodeToUpdate); + logger.debug("Upodate Hosting Node {}", updatedHostingNode); + boolean deleted = resourceRegistryPublisher.deleteResource(updatedHostingNode); + Assert.assertTrue(deleted); + }