Test on fixed Query Request deserialization

This commit is contained in:
Fabio Sinibaldi 2021-12-01 12:42:39 +01:00
parent 8118177c6d
commit ce867018a7
1 changed files with 4 additions and 2 deletions

View File

@ -10,11 +10,13 @@ import org.gcube.application.geoportal.common.model.legacy.Concessione;
import org.gcube.application.geoportal.common.model.legacy.Concessione.Paths;
import org.gcube.application.geoportal.common.model.legacy.LayerConcessione;
import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport.ValidationStatus;
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
import org.gcube.application.geoportal.common.utils.FileSets;
import org.gcube.application.geoportal.common.utils.Files;
import org.gcube.application.geoportal.common.utils.StorageUtils;
import org.gcube.application.geoportal.service.utils.Serialization;
import org.gcube.common.storagehub.model.query.Queries;
import org.json.JSONObject;
import org.junit.Assert;
import org.junit.Before;
@ -113,10 +115,10 @@ public class ConcessioniOverMongoTest extends BasicServiceTestUnit{
private static <T> Iterator<T> queryFile(String filename, WebTarget target, Class<T> clazz) throws Exception {
String queryString=TestConcessioniQueries.queries.get(filename);
QueryRequest req= Serialization.parseQuery(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);
Entity.entity(Serialization.write(req),MediaType.APPLICATION_JSON)),String.class);
return Serialization.readCollection(result,clazz);
}