Refactored EntityManagement

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@141261 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2016-12-19 16:00:49 +00:00
parent 21c7896b85
commit a338ff3ef2
1 changed files with 16 additions and 1 deletions

View File

@ -89,6 +89,21 @@ public class SmartgearResourcesTest extends ScopedTest {
hostingNode = Entities.unmarshal(HostingNode.class, hnJson); hostingNode = Entities.unmarshal(HostingNode.class, hnJson);
logger.debug("Unmarshalled {} {}", HostingNode.NAME, hostingNode); logger.debug("Unmarshalled {} {}", HostingNode.NAME, hostingNode);
UUID hnUUID = hostingNode.getHeader().getUUID();
resourceManagement = new ResourceManagement();
resourceManagement.setUUID(hnUUID);
String read = resourceManagement.read();
HostingNode readHN = Entities.unmarshal(HostingNode.class, read);
logger.debug("Read {} {}", EService.NAME, readHN);
Assert.assertTrue(hnUUID.compareTo(readHN.getHeader().getUUID())==0);
resourceManagement = new ResourceManagement();
resourceManagement.setUUID(hnUUID);
boolean deleted = resourceManagement.delete();
Assert.assertTrue(deleted);
} }
@Test @Test
@ -110,7 +125,7 @@ public class SmartgearResourcesTest extends ScopedTest {
resourceManagement.setUUID(eServiceUUID); resourceManagement.setUUID(eServiceUUID);
String read = resourceManagement.read(); String read = resourceManagement.read();
EService readEService = Entities.unmarshal(EService.class, read); EService readEService = Entities.unmarshal(EService.class, read);
logger.debug("Read {} {}", EService.NAME, eService); logger.debug("Read {} {}", EService.NAME, readEService);
Assert.assertTrue(eServiceUUID.compareTo(readEService.getHeader().getUUID())==0); Assert.assertTrue(eServiceUUID.compareTo(readEService.getHeader().getUUID())==0);