Logging in serialization
This commit is contained in:
parent
add1754dcc
commit
820ea7203f
|
@ -54,10 +54,9 @@ public class StatelessClientTests extends BasicVreTests{
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void query() throws Exception {
|
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
|
// No Transformation
|
||||||
System.out.print("First Registered \t");
|
System.out.print("First Registered \t");
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.bson.Document;
|
import org.bson.Document;
|
||||||
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
||||||
|
|
||||||
|
@ -12,6 +13,7 @@ import java.io.IOException;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
public class Serialization {
|
public class Serialization {
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,7 +45,9 @@ public class Serialization {
|
||||||
|
|
||||||
|
|
||||||
public static QueryRequest parseQuery(String queryString) throws IOException {
|
public static QueryRequest parseQuery(String queryString) throws IOException {
|
||||||
|
log.debug("Parsing query Request {} ",queryString);
|
||||||
Document queryDocument = Document.parse(queryString);
|
Document queryDocument = Document.parse(queryString);
|
||||||
|
log.debug("Document is ",queryDocument.toJson());
|
||||||
QueryRequest req = new QueryRequest();
|
QueryRequest req = new QueryRequest();
|
||||||
if (queryDocument.containsKey("ordering"))
|
if (queryDocument.containsKey("ordering"))
|
||||||
req.setOrdering(Serialization.read(((Document) queryDocument.get("ordering")).toJson(), QueryRequest.OrderedRequest.class));
|
req.setOrdering(Serialization.read(((Document) queryDocument.get("ordering")).toJson(), QueryRequest.OrderedRequest.class));
|
||||||
|
|
|
@ -113,7 +113,7 @@ public class ConcessioniOverMongoTest extends BasicServiceTestUnit{
|
||||||
|
|
||||||
|
|
||||||
private static <T> Iterator<T> queryFile(String filename, WebTarget target, Class<T> clazz) throws Exception {
|
private static <T> Iterator<T> queryFile(String filename, WebTarget target, Class<T> 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(
|
String result = check(target.path(InterfaceConstants.Methods.QUERY_PATH).request(MediaType.APPLICATION_JSON_TYPE).post(
|
||||||
Entity.entity(queryString,MediaType.APPLICATION_JSON)),String.class);
|
Entity.entity(queryString,MediaType.APPLICATION_JSON)),String.class);
|
||||||
|
|
Loading…
Reference in New Issue