Serialization utils

This commit is contained in:
Fabio Sinibaldi 2021-01-28 15:29:51 +01:00
parent 030488356c
commit 6e5c6ba6ff
4 changed files with 13 additions and 1 deletions

View File

@ -2,6 +2,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
# Changelog for org.gcube.application.geoportal-client # Changelog for org.gcube.application.geoportal-client
## [v1.0.4-SNAPSHOT] - 2020-11-11
Serialization utils
## [v1.0.3] - 2020-11-11 ## [v1.0.3] - 2020-11-11
Stateful Concessioni Manager client over mongo Stateful Concessioni Manager client over mongo

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.application</groupId> <groupId>org.gcube.application</groupId>
<artifactId>geoportal-client</artifactId> <artifactId>geoportal-client</artifactId>
<version>1.0.3</version> <version>1.0.4-SNAPSHOT</version>
<name>Geoportal Client</name> <name>Geoportal Client</name>

View File

@ -24,4 +24,8 @@ public static final DateTimeFormatter FULL_FORMATTER=DateTimeFormatter.ofPattern
return mapper.readerFor(clazz).readValue(jsonString); return mapper.readerFor(clazz).readValue(jsonString);
} }
public static String write(Object obj) throws JsonProcessingException, IOException {
return mapper.writeValueAsString(obj);
}
} }

View File

@ -8,6 +8,7 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import org.gcube.application.geoportal.client.legacy.ConcessioniManagerI; import org.gcube.application.geoportal.client.legacy.ConcessioniManagerI;
import org.gcube.application.geoportal.client.utils.Serialization;
import org.gcube.application.geoportal.common.model.legacy.Concessione; import org.gcube.application.geoportal.common.model.legacy.Concessione;
import org.gcube.application.geoportal.common.model.legacy.InputStreamDescriptor; import org.gcube.application.geoportal.common.model.legacy.InputStreamDescriptor;
import org.gcube.application.geoportal.common.model.legacy.LayerConcessione; import org.gcube.application.geoportal.common.model.legacy.LayerConcessione;
@ -80,6 +81,9 @@ public class StatefulClientTests extends BasicVreTests{
assertNotNull(l.getWmsLink()); assertNotNull(l.getWmsLink());
assertNotNull(published.getCentroidLat()); assertNotNull(published.getCentroidLat());
assertNotNull(published.getCentroidLong()); assertNotNull(published.getCentroidLong());
System.out.println(Serialization.write(published));
System.out.println(Serialization.write(published.getReport()));
} }
@Test @Test