added junit test
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/grsf-publisher-ws@132961 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3104372ed3
commit
91f56dca42
|
@ -113,17 +113,18 @@ public class JTests {
|
|||
HashMap<String, String> extras = new HashMap<String, String>();
|
||||
extras.put("test1", "testValue");
|
||||
extras.put("test2", "test2Value");
|
||||
recordFishery.setProperties(extras);
|
||||
extras.put("type", "Polygon");
|
||||
extras.put("coordinates", "[[[2.05827, 49.8625],[2.05827, 55.7447], [-6.41736, 55.7447], [-6.41736, 49.8625], [2.05827, 49.8625]]]");
|
||||
recordFishery.setExtras(extras);
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
//Object to JSON in String
|
||||
String jsonInString = mapper.writeValueAsString(recordFishery);
|
||||
|
||||
System.out.println(jsonInString);
|
||||
|
||||
|
||||
// JSON back to object
|
||||
FisheryRecord converted = mapper.readValue(jsonInString, recordFishery.getClass());
|
||||
|
||||
System.out.println(converted);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue