From 4a3dba009735da7614fa01e3baffbfa1ada0cc6a Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Thu, 1 Aug 2024 14:17:35 +0200 Subject: [PATCH] Added test --- .../gcube/grsf/publisher/record/RecordTest.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/gcube/grsf/publisher/record/RecordTest.java b/src/test/java/org/gcube/grsf/publisher/record/RecordTest.java index fe8e1d1..c455b98 100644 --- a/src/test/java/org/gcube/grsf/publisher/record/RecordTest.java +++ b/src/test/java/org/gcube/grsf/publisher/record/RecordTest.java @@ -20,11 +20,14 @@ import javax.ws.rs.core.UriInfo; import org.gcube.com.fasterxml.jackson.databind.ObjectMapper; import org.gcube.com.fasterxml.jackson.databind.node.ArrayNode; import org.gcube.com.fasterxml.jackson.databind.node.ObjectNode; +import org.gcube.gcat.persistence.ckan.CKANPackageTrash; import org.gcube.grsf.publisher.ContextTest; import org.gcube.grsf.publisher.ckan.record.FisheryRecord; import org.gcube.grsf.publisher.ckan.record.Record; import org.gcube.grsf.publisher.ckan.record.StockRecord; import org.gcube.grsf.publisher.ckan.record.TraceabilityUnitRecord; +import org.gcube.grsf.publisher.configuration.GRSFCatalogueConfiguration; +import org.gcube.grsf.publisher.configuration.GRSFCatalogueConfigurationFactory; import org.gcube.grsf.publisher.freemarker.FreeMarker; import org.gcube.grsf.publisher.freemarker.FreeMarkerTest; import org.junit.Assert; @@ -487,7 +490,7 @@ public class RecordTest extends ContextTest { String[] types = new String[] { FISHERY, STOCK, TRACEABILITY_UNIT }; - long sleepTime = TimeUnit.MILLISECONDS.toMillis(500); + long sleepTime = TimeUnit.MILLISECONDS.toMillis(200); for (String type : types) { boolean go = true; @@ -522,4 +525,13 @@ public class RecordTest extends ContextTest { } } + @Ignore + @Test + public void emptyThrash() throws Exception { + ContextTest.setContextByName(PROD_VRE_GRSF_PRE); + GRSFCatalogueConfiguration conf = GRSFCatalogueConfigurationFactory.getInstance(); + CKANPackageTrash ckanPackageTrash = new CKANPackageTrash(conf); + ckanPackageTrash.setOwnOnly(false); + ckanPackageTrash.empty(); + } }