diff --git a/geoportal-client/src/test/java/org/gcube/application/geoportal/clients/StatelessClientTests.java b/geoportal-client/src/test/java/org/gcube/application/geoportal/clients/StatelessClientTests.java index 5d5602e..c9f953b 100644 --- a/geoportal-client/src/test/java/org/gcube/application/geoportal/clients/StatelessClientTests.java +++ b/geoportal-client/src/test/java/org/gcube/application/geoportal/clients/StatelessClientTests.java @@ -54,10 +54,9 @@ public class StatelessClientTests extends BasicVreTests{ @Test public void query() throws Exception { - QueryRequest req=new QueryRequest(); - req.setFilter(Document.parse("{ \"nome\" : { \"$eq\" : \"mock\" } }")); - System.out.println("FRA "+ count(client.query(req))); + System.out.println("FRA "+ count(client.query( + Queries.parse(TestConcessioniQueries.queries.get("emptyresult.json"))))); // No Transformation System.out.print("First Registered \t"); diff --git a/geoportal-service/src/main/java/org/gcube/application/geoportal/service/utils/Serialization.java b/geoportal-service/src/main/java/org/gcube/application/geoportal/service/utils/Serialization.java index dbe892c..676edbe 100644 --- a/geoportal-service/src/main/java/org/gcube/application/geoportal/service/utils/Serialization.java +++ b/geoportal-service/src/main/java/org/gcube/application/geoportal/service/utils/Serialization.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import lombok.extern.slf4j.Slf4j; import org.bson.Document; import org.gcube.application.geoportal.common.model.rest.QueryRequest; @@ -12,6 +13,7 @@ import java.io.IOException; import java.time.format.DateTimeFormatter; import java.util.Iterator; +@Slf4j public class Serialization { @@ -43,7 +45,9 @@ public class Serialization { public static QueryRequest parseQuery(String queryString) throws IOException { + log.debug("Parsing query Request {} ",queryString); Document queryDocument = Document.parse(queryString); + log.debug("Document is ",queryDocument.toJson()); QueryRequest req = new QueryRequest(); if (queryDocument.containsKey("ordering")) req.setOrdering(Serialization.read(((Document) queryDocument.get("ordering")).toJson(), QueryRequest.OrderedRequest.class)); diff --git a/geoportal-service/src/test/java/org/gcube/application/geoportal/service/ConcessioniOverMongoTest.java b/geoportal-service/src/test/java/org/gcube/application/geoportal/service/ConcessioniOverMongoTest.java index d67d90f..f856b84 100644 --- a/geoportal-service/src/test/java/org/gcube/application/geoportal/service/ConcessioniOverMongoTest.java +++ b/geoportal-service/src/test/java/org/gcube/application/geoportal/service/ConcessioniOverMongoTest.java @@ -113,7 +113,7 @@ public class ConcessioniOverMongoTest extends BasicServiceTestUnit{ private static Iterator queryFile(String filename, WebTarget target, Class clazz) throws Exception { - String queryString= TestConcessioniQueries.queries.get(filename); + String queryString=TestConcessioniQueries.queries.get(filename); String result = check(target.path(InterfaceConstants.Methods.QUERY_PATH).request(MediaType.APPLICATION_JSON_TYPE).post( Entity.entity(queryString,MediaType.APPLICATION_JSON)),String.class);