From 47eaef04936a449e37b6cf5b14200fd72a81cde2 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Thu, 28 Jan 2016 17:21:20 +0000 Subject: [PATCH] Fixing Tests git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-publishing/document-store-lib-couchdb@122622 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../persistence/PersistenceCouchBaseTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/test/java/org/gcube/documentstore/persistence/PersistenceCouchBaseTest.java b/src/test/java/org/gcube/documentstore/persistence/PersistenceCouchBaseTest.java index ed7b56b..5588705 100644 --- a/src/test/java/org/gcube/documentstore/persistence/PersistenceCouchBaseTest.java +++ b/src/test/java/org/gcube/documentstore/persistence/PersistenceCouchBaseTest.java @@ -24,6 +24,7 @@ public class PersistenceCouchBaseTest { @Test public void testJsonNodeUsageRecordConversions() throws Exception { + ScopeProvider.instance.set("/gcube/devNext"); Record record = TestUsageRecord.createTestServiceUsageRecordAutomaticScope(); logger.debug("UsageRecord : {}", record.toString()); JsonNode node = PersistenceCouchDB.usageRecordToJsonNode(record); @@ -33,6 +34,18 @@ public class PersistenceCouchBaseTest { Assert.assertEquals(0, r.compareTo(record)); } + @Test + public void testJsonNodeUsageRecordConversionsWithNestedMap() throws Exception { + ScopeProvider.instance.set("/gcube/devNext"); + Record record = TestUsageRecord.createTestTaskUsageRecordAutomaticScope(); + logger.debug("UsageRecord : {}", record.toString()); + JsonNode node = PersistenceCouchDB.usageRecordToJsonNode(record); + logger.debug("Node : {}", node.toString()); + Record r = PersistenceCouchDB.jsonNodeToUsageRecord(node); + Assert.assertEquals(0, record.compareTo(r)); + Assert.assertEquals(0, r.compareTo(record)); + } + public void testProxyWithTestConfiguration() throws Exception{ // Production-Preproduction Nodes //URL url = new URL("http://accounting-d4s.d4science.org");